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< OwnerClass > Class Template Reference

This class is a useful way of tracking down hard to find memory leaks when the regular LeakedObjectDetector isn't enough. More...

#include <juce_HeavyweightLeakedObjectDetector.h>

Classes

struct  BacktraceMapHolder
 

Public Member Functions

 HeavyweightLeakedObjectDetector () noexcept
 
 HeavyweightLeakedObjectDetector (const HeavyweightLeakedObjectDetector &) noexcept
 
 ~HeavyweightLeakedObjectDetector ()
 

Private Types

typedef std::map< HeavyweightLeakedObjectDetector< OwnerClass > *, StringBacktraceMap
 

Static Private Member Functions

static BacktraceMapgetBacktraceMap ()
 
static const char * getLeakedObjectClassName ()
 

Detailed Description

template<class OwnerClass>
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.

As well as firing when any instances of the OwnerClass type are leaked, it will print out a stack trace showing where the leaked object was created. This is obviously quite a heavyweight task so, unlike the LeakedObjectDetector which should be always be added to your classes, you should only use this object temporarily when you are debugging and remove it when finished.

To use it, use the JUCE_HEAVYWEIGHT_LEAK_DETECTOR macro as a simple way to put one in your class declaration.

@tags{Core}

Member Typedef Documentation

◆ BacktraceMap

template<class OwnerClass >
typedef std::map<HeavyweightLeakedObjectDetector<OwnerClass>*, String> juce::HeavyweightLeakedObjectDetector< OwnerClass >::BacktraceMap
private

Constructor & Destructor Documentation

◆ HeavyweightLeakedObjectDetector() [1/2]

◆ HeavyweightLeakedObjectDetector() [2/2]

◆ ~HeavyweightLeakedObjectDetector()

Member Function Documentation

◆ getBacktraceMap()

◆ getLeakedObjectClassName()

template<class OwnerClass >
static const char* juce::HeavyweightLeakedObjectDetector< OwnerClass >::getLeakedObjectClassName ( )
inlinestaticprivate

The documentation for this class was generated from the following file: