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.DictFree(handle); Context = null; } }
/// <summary> /// Frees the dictionary handle. /// </summary> protected override bool ReleaseHandle() { Interop.DictFree(handle); return(true); }