JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::LeakedObjectDetector< OwnerClass >::LeakCounter Class Reference
Collaboration diagram for juce::LeakedObjectDetector< OwnerClass >::LeakCounter:

Public Member Functions

 LeakCounter ()=default
 
 ~LeakCounter ()
 

Public Attributes

Atomic< intnumObjects
 

Constructor & Destructor Documentation

◆ LeakCounter()

template<class OwnerClass >
juce::LeakedObjectDetector< OwnerClass >::LeakCounter::LeakCounter ( )
default

◆ ~LeakCounter()

template<class OwnerClass >
juce::LeakedObjectDetector< OwnerClass >::LeakCounter::~LeakCounter ( )
inline

If you hit this, then you've leaked one or more objects of the type specified by the 'OwnerClass' template parameter - the name should have been printed by the line above.

If you're leaking, it's probably because you're using old-fashioned, non-RAII techniques for your object management. Tut, tut. Always, always use std::unique_ptrs, OwnedArrays, ReferenceCountedObjects, etc, and avoid the 'delete' operator at all costs!

References DBG, juce::LeakedObjectDetector< OwnerClass >::getLeakedObjectClassName(), jassertfalse, juce::LeakedObjectDetector< OwnerClass >::LeakCounter::numObjects, and juce::Atomic< Type >::value.

Member Data Documentation

◆ numObjects


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