Example #1
0
	~ComPtr()
	{
		if (m_ptr)
		{
			m_ptr->Release();
		}
	}
Example #2
0
	inline void Clear()
	{
		if (ptr) {
			ptr->Release();
			ptr = NULL;
		}
	}
Example #3
0
	inline void Clear()
	{
		if (ptr) {
			ptr->Release();
			ptr = nullptr;
		}
	}
Example #4
0
	inline void Replace(T *p)
	{
		if (ptr != p) {
			if (p)   p->AddRef();
			if (ptr) ptr->Release();
			ptr = p;
		}
	}
Example #5
0
	inline ULONG Release()
	{
		ULONG ref;

		if (!ptr) return 0;
		ref = ptr->Release();
		ptr = nullptr;
		return ref;
	}
Example #6
0
 ~AutoCOMPtr() {
    if (m_ptr) {
       m_ptr->Release();
    }
 }
Example #7
0
	inline void Kill()
	{
		if (ptr)
			ptr->Release();
	}