In latest 1.53.59 tip, I am getting a “*** Dangling pointer deletion! Class: HeapBlock” assertion failure that did not occur with version 1.53.15 that I previously used.
This happens when a VSTPluginInstance is deleted. After the destructor ~VSTPluginInstance() comes to its end, the compiler deletes its members, one of them being “VSTMidiEventList midiEventsToSend”, whose destructor looks like this:
~VSTMidiEventList()
{
freeEvents();
}
The call to freeEvents() seems to clash in some way with the subsequent automatic deletion of the member “events”, which is exactly where the “dangling pointer” warning is issued: It happens in the destructor of HeapBlock. Looks like a duplicate deletion to me.
HeapBlock <VstEvents> events;
Why is this?
I should note this also happens when my plugin is scanned (Reaper OSX), but never actually played. It also happens when I instantiate and delete VSTPluginInstances programmatically inside my plugin.
The bug does not appear with the JuceDemoPlugin VST (when it is scanned or instantiated/deleted), so this is probably my own fault and I seem to have missed something really important that, by accident, simply did not show up in the previous Juce version(?)
Any idea where I should start looking?
Thanks in advance,
Andre