3ds Max C++ API Reference
Loading...
Searching...
No Matches
LeakedObjectInstances< Obj > Class Template Reference

This class is derived from in order to automatically track existing instances, and at shutdown write to Debug Output the creation count for leaked instances. More...

#include <LeakedObjectInstances.h>

Public Member Functions

 LeakedObjectInstances ()
 
 LeakedObjectInstances (const LeakedObjectInstances &)
 
 ~LeakedObjectInstances ()
 

Detailed Description

template<class Obj>
class LeakedObjectInstances< Obj >

This class is derived from in order to automatically track existing instances, and at shutdown write to Debug Output the creation count for leaked instances.

The template class Obj should typically be set to the class deriving from this class. For example: class ParamBlockDesc2 : private LeakedObjectInstances<ParamBlockDesc2> On shutdown, if leakage is present the output to Debug Output would be: 2022/08/26 14:28:00 [12616] : 55114ms : **Leaked class ParamBlockDesc2 instances: 587, 588

Constructor & Destructor Documentation

◆ LeakedObjectInstances() [1/2]

33 {
34 InstanceCreated(this);
35 }

◆ LeakedObjectInstances() [2/2]

LeakedObjectInstances ( const LeakedObjectInstances< Obj > &  )
inline
37 {
38 InstanceCreated(this);
39 }

◆ ~LeakedObjectInstances()

~LeakedObjectInstances ( )
inline
41 {
42 InstanceDeleted(this);
43 }