private void Dispose(bool disposing) { var handle = Interlocked.Exchange(ref _handle, IntPtr.Zero); if (IsOwner && handle != IntPtr.Zero) // only dispose undisposed objects that we own { Interop.FreeProfileSequenceDescription(handle); Context = null; } }
/// <summary> /// Frees the profile sequence descriptor. /// </summary> protected override bool ReleaseHandle() { Interop.FreeProfileSequenceDescription(handle); return(true); }