So total beginner here with C++ and JUCE. I have been following a Kadenze course to help walk me through how to develop an audio plugin. Unfortunately this course is pretty outdated and I’ve had to teach myself a good chunk of it. I am getting error when I try to write and restore my parameters from the memory block. Below is what my current SetState and GetState functions look like.
Looks like you’ve got a double deletion going on in getStateInformation(). This line is the culprit:
The XmlElement class automatically deletes child nodes when their parent object is deleted, so you have to transfer ownership of any child nodes that are added. Since you’re using a unique_ptr, you can do this by using release() instead of get() in the addChildElement() call: