/// <summary> /// Dispose pattern implementation of dispose method. /// </summary> /// <param name="disposing">True if disposing, false if finalizing.</param> protected virtual void Dispose(bool disposing) { if (IsDisposed) { return; } if (MirrorTexturePtr != IntPtr.Zero) { _ovr.DestroyMirrorTexture(_sessionPtr, MirrorTexturePtr); MirrorTexturePtr = IntPtr.Zero; } GC.SuppressFinalize(this); IsDisposed = true; }
/// <summary> /// Dispose pattern implementation of dispose method. /// </summary> /// <param name="disposing">True if disposing, false if finalizing.</param> protected virtual void Dispose(bool disposing) { if (IsDisposed) { return; } if (MirrorTexturePtr != IntPtr.Zero) { _ovr.DestroyMirrorTexture(_sessionPtr, MirrorTexturePtr); MirrorTexturePtr = IntPtr.Zero; // Notify subscribers that this object has been disposed. if (Disposed != null) { Disposed(this); } } GC.SuppressFinalize(this); IsDisposed = true; }