Premature optimization? Memory leak detector recommendations requested


#1

Writing a new app in JUCE after being out for a while. Will use OS X for development. The JUCE API is so beautifully designed I probably don’t need it, but assuming I miss calling a destructor somewhere what’s the best product/lib around to use for memory leak detection?


#2

Stick this convenient macro at the end of your class header:

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (YourClass)


#3

…and enjoy using ScopedPointers and OwnedArrays. Takes a lot of possible errors away.


#4

HA! Leave it to the Julesmeister! Can’t wait to test this bad boy. Thank you!

Normally I read API docs cover to cover. Annoyed I don’t remember this and greatly appreciate the prompt reply!


#5

Hmm, yeah I’m not exactly sure if all the macros and flags are documented anywhere… may be wrong though…