Thanks for the suggestions, will try those, and I’ve already used one of Jim’s debugging tools in the project so I’ll give the advanced leak detector a spin, cheers
So I think its to do with the SVG parser. Below is a typical chunk of my GUI code.
I’m wondering if each Drawable given to setImages needs to be a ScopedPointer rather than passing the returned pointer from createFromSVG?
Hard to track down leaks have been diagnosed quickly here using the Clang LeakSanitizer and AddressSanitizer on Linux. I think it is available in XCode on Scheme/Diagnostics page too.
Maybe another tip: When you hit the first leaked object assertion, let the program keep running, as you’ll probably get more, with different objects, that will make it clear what’s going on. I was kind of assuming you’d done that and were posting here because only a ColourGradient was leaking, which would be very odd, but maybe that’s not the case.
If you’re on Windows, I found the _CrtSetBreakAlloc(allocationIndex) function to be incredible useful for tracking down leaks (even for those who slip through the crack of JUCE’s leak detector).
I just use the allocation number from the leak report that is shown after
terminating the debugging session - this just works with "deterministic"
programs which always allocate in the same order though…