ID3DDestructionNotifier interface (d3dcommon.h)

ID3DDestructionNotifier is an interface that you can use to register for callbacks when a Direct3D nano-COM object is destroyed.

To acquire an instance of this interface, call on a Direct3D object with the IID of ID3DDestructionNotifier.

Using ID3DDestructionNotifier instead of ID3D12Object::SetPrivateDataInterface or Direct3D 11 equivalents provides stronger guarantees about the order of destruction. With ID3DDestructionNotifier, implicit relationships—such as an ID3D11View holding a reference to its underlying ID3D11Resource—are guaranteed to be valid and for the referenced object (here, the ID3D11Object) to still be alive when the destruction callback is invoked. With ID3D12Object::SetPrivateDataInterface, the implicit references can be released before the destruction callback is invoked.

It isn't safe to access the object being destructed during the callback.

Inheritance

The ID3DDestructionNotifier interface inherits from the IUnknown interface.

Methods

The ID3DDestructionNotifier interface has these methods.

 
ID3DDestructionNotifier::RegisterDestructionCallback

Registers a user-defined callback to be invoked on destruction of the object from which this ID3DDestructionNotifier was created.
ID3DDestructionNotifier::UnregisterDestructionCallback

Unregisters a callback that was registered with RegisterDestructionCallback.

Remarks

The ID3DDestructionNotifier can be used to track resources which are being unexpectedly released early, or providing a log of object disposal.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header d3dcommon.h

See also

ID3DDestructionNotifier::RegisterDestructionCallback

ID3DDestructionNotifier::UnregisterDestructionCallback

Common Version Interfaces