nx_metadata_sdk 1.0 Metadata SDK

Public Member Functions | List of all members
nx::sdk::IRefCountableRegistry Class Referenceabstract

`#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

## Detailed Description

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.

## Constructor & Destructor Documentation

## ◆ ~IRefCountableRegistry()

virtual nx::sdk::IRefCountableRegistry::~IRefCountableRegistry | ( |  | ) |
| virtual default

Logs the remaining (leaked) ref-countable objects.

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

- src/nx/sdk/helpers/i_ref_countable_registry.h