private void TraceRelease(int rcwCount, ref bool addRef) { if (!addRef) { // Temporarily add a ref so that we can safely call IUnknown::Release // to report the ref count in the log. RdMarshal.AddRef(_pUnk); } var refCount = RdMarshal.Release(_pUnk); Debug.Print($"ComPointer:: Disposed: _pUnk: {RdMarshal.FormatPtr(_pUnk)} _interface: {typeof(TComInterface).Name} - {Interface.GetHashCode()} addRef: {_addRef} rcwCount: {rcwCount} refCount: {refCount}"); addRef = false; }
private void ConstructorObjectPrint() { Debug.Print($"ComPointer:: Created from object: pUnk: {RdMarshal.FormatPtr(_pUnk)} interface: {typeof(TComInterface).Name} - {Interface.GetHashCode()} addRef: {_addRef}"); }
private void ConstructorPointerPrint(int refCount) { Debug.Print($"ComPointer:: Created from pointer: pUnk: {RdMarshal.FormatPtr(_pUnk)} interface: {typeof(TComInterface).Name} - {Interface.GetHashCode()} addRef: {_addRef} refCount: {refCount}"); }