JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce_HeavyweightLeakedObjectDetector.h File Reference
This graph shows which files directly or indirectly include this file:

Classes

class  juce::HeavyweightLeakedObjectDetector< OwnerClass >
 This class is a useful way of tracking down hard to find memory leaks when the regular LeakedObjectDetector isn't enough. More...
 
struct  juce::HeavyweightLeakedObjectDetector< OwnerClass >::BacktraceMapHolder
 

Namespaces

 juce
 

Macros

#define JUCE_HEAVYWEIGHT_LEAK_DETECTOR(OwnerClass)
 This macro lets you embed a heavyweight leak-detecting object inside a class. More...
 

Macro Definition Documentation

◆ JUCE_HEAVYWEIGHT_LEAK_DETECTOR

#define JUCE_HEAVYWEIGHT_LEAK_DETECTOR (   OwnerClass)
Value:
friend class juce::HeavyweightLeakedObjectDetector<OwnerClass>; \
static const char* getLeakedObjectClassName() noexcept { return #OwnerClass; } \
juce::HeavyweightLeakedObjectDetector<OwnerClass> JUCE_JOIN_MACRO (leakDetector, __LINE__);

This macro lets you embed a heavyweight leak-detecting object inside a class.

To use it, simply declare a JUCE_HEAVYWEIGHT_LEAK_DETECTOR (YourClassName) inside a private section of the class declaration. E.g.

class MyClass
{
public:
MyClass();
void blahBlah();
private:
};

NB: you should only use this when you really need to track down a tricky memory leak, and should never leave one of these inside a class!

See also
HeavyweightLeakedObjectDetector, JUCE_LEAK_DETECTOR, LeakedObjectDetector
JUCE_JOIN_MACRO
#define JUCE_JOIN_MACRO(item1, item2)
A good old-fashioned C macro concatenation helper.
Definition: juce_PlatformDefs.h:199
juce::HeavyweightLeakedObjectDetector
This class is a useful way of tracking down hard to find memory leaks when the regular LeakedObjectDe...
Definition: juce_HeavyweightLeakedObjectDetector.h:43
JUCE_HEAVYWEIGHT_LEAK_DETECTOR
#define JUCE_HEAVYWEIGHT_LEAK_DETECTOR(OwnerClass)
This macro lets you embed a heavyweight leak-detecting object inside a class.
Definition: juce_HeavyweightLeakedObjectDetector.h:135
juce::HeavyweightLeakedObjectDetector::getLeakedObjectClassName
static const char * getLeakedObjectClassName()
Definition: juce_HeavyweightLeakedObjectDetector.h:104