MemoryLeak with Message

Consider the following

bool ApplicationCommandTarget::tryToInvoke (const InvocationInfo& info, const bool async)
{

<snip>
messageInvoker->postMessage (new Message (0, 0, 0, new ApplicationCommandTarget::InvocationInfo (info)));

Who deletes the allocated InvocationInfo?

It goes to MessageManager::instance->postMessageToQueue which then goes to juce_postMessageToSystemQueue which then calls customEvent.

void MessageManager::deliverMessage (void* message) deletes the Message but not the pointer.

I might just be paranoid!

Don’t worry - the CommandTargetMessageInvoker deletes it just after using it…

Thanks! Just chasing down a MessageManager assertion on shutdown(object still pending) and that grabbed my attention. (jassert (numPendingMessages == 0):wink:

Oh, disregard, I see you removed the assertion in the tip.