nx_metadata_sdk
1.0
Metadata SDK
|
#include <i_ref_countable_registry.h>
Public Member Functions | |
virtual | ~IRefCountableRegistry ()=default |
virtual void | notifyCreated (const nx::sdk::IRefCountable *refCountable, int refCount)=0 |
virtual void | notifyDestroyed (const nx::sdk::IRefCountable *refCountable, int refCount)=0 |
Debugging mechanism that tracks ref-countable objects to detect leaks, double-frees and the like. This registry works automatically for any classes inherited from nx::sdk::RefCountable.
An assertion will fail if any discrepancy is detected.
The Server and each Plugin have their own instance of such registry, created and assigned to each LibContext by the Server. Thus, each registry is tracking objects created/destroyed in the respective library.
The instance of a registry is destroyed when the LibContext destructor is called, i.e. on the static deinitialization phase. On destruction, it attempts to detect and log objects which were not deleted, failing an assertion if there are any such objects.
For a high-level description of this mechanism, see LibContext and RefCountableRegistry mechanisms.
|
virtualdefault |
Logs the remaining (leaked) ref-countable objects.