JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce_LeakedObjectDetector.h File Reference
This graph shows which files directly or indirectly include this file:

Classes

class  juce::LeakedObjectDetector< OwnerClass >
 Embedding an instance of this class inside another class can be used as a low-overhead way of detecting leaked instances. More...
 
class  juce::LeakedObjectDetector< OwnerClass >::LeakCounter
 

Namespaces

 juce
 

Macros

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

Macro Definition Documentation

◆ JUCE_LEAK_DETECTOR

#define JUCE_LEAK_DETECTOR (   OwnerClass)
Value:
friend class juce::LeakedObjectDetector<OwnerClass>; \
static const char* getLeakedObjectClassName() noexcept { return #OwnerClass; } \
juce::LeakedObjectDetector<OwnerClass> JUCE_JOIN_MACRO (leakDetector, __LINE__);
#define JUCE_JOIN_MACRO(item1, item2)
A good old-fashioned C macro concatenation helper.
Definition: juce_PlatformDefs.h:165
Embedding an instance of this class inside another class can be used as a low-overhead way of detecti...
Definition: juce_LeakedObjectDetector.h:42
static const char * getLeakedObjectClassName()
Definition: juce_LeakedObjectDetector.h:97

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

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

class MyClass
{
public:
MyClass();
void blahBlah();
private:
};
See also
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR, LeakedObjectDetector

Referenced by juce::AudioBuffer< float >::allocateChannels(), juce::SpeakerMappings::VstSpeakerConfigurationHolder::get(), juce::SharedResourcePointer< SharedObjectType >::initialise(), juce::dsp::FIR::Filter< SampleType >::processSingleSample(), juce::CodeTokeniser::~CodeTokeniser(), juce::InputSource::~InputSource(), and juce::AudioPluginFormat::InstantiationCompletionCallback::~InstantiationCompletionCallback().