JUCE
Public Member Functions | List of all members
LeakedObjectDetector< OwnerClass > Class Template Reference

Embedding an instance of this class inside another class can be used as a low-overhead way of detecting leaked instances. More...

Public Member Functions

 LeakedObjectDetector () noexcept
 
 LeakedObjectDetector (const LeakedObjectDetector &) noexcept
 
 ~LeakedObjectDetector ()
 

Detailed Description

template<class OwnerClass>
class LeakedObjectDetector< OwnerClass >

Embedding an instance of this class inside another class can be used as a low-overhead way of detecting leaked instances.

This class keeps an internal static count of the number of instances that are active, so that when the app is shutdown and the static destructors are called, it can check whether there are any left-over instances that may have been leaked.

To use it, use the JUCE_LEAK_DETECTOR macro as a simple way to put one in your class declaration. Have a look through the juce codebase for examples, it's used in most of the classes.

Constructor & Destructor Documentation

template<class OwnerClass >
LeakedObjectDetector< OwnerClass >::LeakedObjectDetector ( )
noexcept
template<class OwnerClass >
LeakedObjectDetector< OwnerClass >::LeakedObjectDetector ( const LeakedObjectDetector< OwnerClass > &  )
noexcept
template<class OwnerClass >
LeakedObjectDetector< OwnerClass >::~LeakedObjectDetector ( )

References DBG, and jassertfalse.


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