[SOLVED] JUCE Plugin Error: *** Leaked objects detected: 2 instance(s) of class Message

For some reason when I run the JucePluginHost with a juce plugin application, if I close the plugin host, it first gives this error message:

*** Leaked objects detected: 2 instance(s) of class  Message
JUCE Assertion failure in juce_leakedobjectdetector.h:90
AudioPluginHost.exe has triggered a breakpoint.
*** Leaked objects detected: 1 instance(s) of class  AttributeList
JUCE Assertion failure in juce_leakedobjectdetector.h:90
AudioPluginHost.exe has triggered a breakpoint.

And this happens even if I start a complete new juce plugin project with no changes(only that default hello world text).
How can you remove these errors? And also, is there a way to know which line of code contains the pointer which caused the memory leak as atm I don’t know anyway to debug this problem on my own.

SOLUTION: I found out why I got the error. First of all the leaks come from the Juce AudioPluginHost, that explains why despite creating a brand new vst plugin project, I still get the memory leaks. Therefore this basically means you don’t have to worry about those leaks at all for your plugin. Now the reason the AudioPluginHost does that is: some external vsts aren’t fully supported. I had RealGuitar vst by MusicLab in the host(used as an audio input to test my effect plugins), and as soon as I removed it, the errors stopped happening.

Are you using “new” or “delete” anywhere in your code? If so don’t!

Edit: just re-read and saw that you get this with a brand new project, how odd.

First thing to do is, can you click continue several times?

A leaked object can be contained in another leaked object, so you will see that one’s leak message afterwards. The last detected leak is the one to start searching…

I did that. The first leaked objects are 2 Message Instances, and after I click continue the other leaked object is AttributeList. After that the program ends.

I have a similar problem… Brand-new project leaks memory.
(But leaking objects are different. list)
@rarrar I want to ask your environment. Visual Studio version? JUCE version? Are you making VST3 plugin?

I don’t want to disturb this discussion when @rarrar 's problem and my problem seem not to be the same. So in that case, please ignore my reply!
I just found similarity because he says brand-new project leaks memory, and seems to use Visual Studio(his error says".exe").

I’m using visual studio 2017, and Juce 5.4.3(latest). Also I found out that the error comes from not the vst3 but the default JUCE AudioPluginHost(I still get the error even when I only build the host itself). Also, it only happens when a plugin is loaded into the host.

I am not sure if it’s related, but I get sporadic Juce memory leak errors when using WASAPI audio on Windows 7. It seems to be a random thing which sometimes happens.

I found out why I got the error. First of all the leaks come from the Juce AudioPluginHost, that explains why despite creating a brand new vst plugin project, I still get the memory leaks. Therefore this basically means you don’t have to worry about those leaks at all for your plugin. Now the reason the AudioPluginHost does that is: some external vsts aren’t fully supported. I had RealGuitar vst by MusicLab in the host(used as an audio input to test my effect plugins), and as soon as I removed it, the errors stopped happening.

1 Like