HeapBlock leak in VSTMidiEventList

Hi.

I’m running on OSX with JucePlugin_ProducesMidiOutput = 0 and I’m getting this leak.

Did you read the comment for that assertion:

[code] /** If you hit this, then you’ve managed to delete more instances of this class than you’ve
created… That indicates that you’re deleting some dangling pointers.

            Note that although this assertion will have been triggered during a destructor, it might
            not be this particular deletion that's at fault - the incorrect one may have happened
            at an earlier point in the program, and simply not been detected until now.

            Most errors like this are caused by using old-fashioned, non-RAII techniques for
            your object management. Tut, tut. Always, always use ScopedPointers, OwnedArrays,
            ReferenceCountedObjects, etc, and avoid the 'delete' operator at all costs!
        */[/code]

…sounds like you’re deleting a dangling pointer somewhere - more likely due to something in your own code than mine, otherwise lots of people would be hitting this, I think. But feel free to prove me wrong on that!

You are right, thanks.

That’s very interesting, if I’m changing the HeadBlock const. to

    HeapBlock() noexcept  : data (nullptr)
    {
       static int i = 0;
       i++;
    }

Everything is working fine. removing the int variable makes it leak again.