~ComPtr() { if (m_ptr) { m_ptr->Release(); } }
inline void Clear() { if (ptr) { ptr->Release(); ptr = NULL; } }
inline void Clear() { if (ptr) { ptr->Release(); ptr = nullptr; } }
inline void Replace(T *p) { if (ptr != p) { if (p) p->AddRef(); if (ptr) ptr->Release(); ptr = p; } }
inline ULONG Release() { ULONG ref; if (!ptr) return 0; ref = ptr->Release(); ptr = nullptr; return ref; }
~AutoCOMPtr() { if (m_ptr) { m_ptr->Release(); } }
inline void Kill() { if (ptr) ptr->Release(); }