internal static void InterlockedFree(ref OverlappedCache overlappedCache) { OverlappedCache cache = overlappedCache == null ? null : Interlocked.Exchange<OverlappedCache>(ref overlappedCache, null); if (cache != null) { cache.Free(); } }
protected virtual void ForceReleaseUnmanagedStructures() { this.ReleaseGCHandles(); GC.SuppressFinalize(this); if ((this.m_UnmanagedBlob != null) && !this.m_UnmanagedBlob.IsInvalid) { this.m_UnmanagedBlob.Close(true); this.m_UnmanagedBlob = null; } OverlappedCache.InterlockedFree(ref this.m_Cache); if (this.m_OverlappedEvent != null) { this.m_OverlappedEvent.Close(); this.m_OverlappedEvent = null; } }