I have a problem that occurs when I close the mainWindow, and I tried all day to debug it, still can’t figure it out…
Here’s the errors I’m getting :
> *** Leaked objects detected: 1 instance(s) of class OSXTypeface
JUCE Assertion failure in juce_LeakedObjectDetector.h:95
*** Leaked objects detected: 1 instance(s) of class Typeface
JUCE Assertion failure in juce_LeakedObjectDetector.h:95
*** Leaked objects detected: 4 instance(s) of class Label
JUCE Assertion failure in juce_LeakedObjectDetector.h:95
*** Leaked objects detected: 4 instance(s) of class Font
JUCE Assertion failure in juce_LeakedObjectDetector.h:95
*** Leaked objects detected: 4 instance(s) of class SimpleValueSource
JUCE Assertion failure in juce_LeakedObjectDetector.h:95
*** Leaked objects detected: 4 instance(s) of class ValueSource
JUCE Assertion failure in juce_LeakedObjectDetector.h:95
*** Leaked objects detected: 4 instance(s) of class AsyncUpdater
JUCE Assertion failure in juce_LeakedObjectDetector.h:95
*** Leaked objects detected: 4 instance(s) of class Component
JUCE Assertion failure in juce_LeakedObjectDetector.h:95
*** Leaked objects detected: 4 instance(s) of class MouseCursor
JUCE Assertion failure in juce_LeakedObjectDetector.h:95
I don’t know what I can provide you te help me, just ask whatever you want to see, I’ll answer you
Maybe you can change any raw pointer you can find to ScopedPointer.
Edit: And OwnedArray not to be forgotten…
Remove the deletes and if you need to get rid of something immediately, set the ScopedPointer to nullptr.
HTH
Personally if you have a modern compiler I always try to use std::unique_ptr for ownership (shared_ptr if necessary) and then instantiate any dynamic components via std::make_unique.
A good practice to get into if you can in my opinion as it clearly expresses your intent and ownership. You know you shouldn’t have to stress too much over leaks if your typing std::make_unique for those child components.
If you get really stuck I’ve got a special leak detector version somewhere which tracks the call stack of the objects being constructed and then when you quit tells you exactly where the problem is … let me know if you need me to dig it up. It does make your program run very slowly though
My bacon never lasts long enough for saving. But I’ll keep an eye out for you…I bet lakeland have one. They sent us the catalogue once, and anywhere that has an avocado saver (see http://www.lakeland.co.uk/19461/2-Avocado-Food-Huggers) must also have a bacon saver somewhere