Custom deleter for COM objects. More...
#include <unique_com_ptr.hpp>
Public Member Functions | |
| void | operator() (T *ptr) |
| Release the COM object. | |
Custom deleter for COM objects.
Calls Release() on the managed pointer when it is non-nullptr, satisfying the COM reference-counting contract without requiring explicit cleanup at every call site.
| T | A COM interface type that exposes a Release() method. |
Definition at line 18 of file unique_com_ptr.hpp.
|
inline |
Release the COM object.
If ptr is non-nullptr, ptr->Release() is called. A nullptr is silentrly ignored, matching the behaviour of delete nullptr.
| ptr | Raw pointer to the COM object to release. May be nullptr. |
Definition at line 28 of file unique_com_ptr.hpp.