I’m trying to figure out how to properly manage the memory of my class that has both a Synthesiser and an OwnedArray of SynthesiserVoices which are added to the Synthesiser class instance in the constructor. Upon exiting the app, I get a bad access because it seems that the synthesiser voices are being deleted in two different locations. I’m guessing one is in the Synthesiser class and the other in the OwnedArray class.
I would like to be able to allocate and deallocate voices as I like without this problem occurring. Does anyone have any ideas as to how to solve this? Must I simply declare my own synthesiser class that will hold the OwnedArray of voices? Trying to figure out the best way to procede. Thanks!