コード例 #1
0
 // Utility cleanup routine. Frees the overlapped structure.
 // This should be overridden to free pinned and unmanaged memory in the subclass.
 // It needs to also be invoked from the subclass.
 protected virtual void ForceReleaseUnmanagedStructures()
 {
     // Free the unmanaged memory if allocated.
     if (NetEventSource.IsEnabled)
     {
         NetEventSource.Enter(this);
     }
     _nativeOverlapped.Dispose();
     _nativeOverlapped = null;
     GC.SuppressFinalize(this);
 }
コード例 #2
0
        // Utility cleanup routine. Frees the overlapped structure.
        // This should be overriden to free pinned and unmanaged memory in the subclass.
        // It needs to also be invoked from the subclass.
        protected virtual void ForceReleaseUnmanagedStructures()
        {
            // Free the unmanaged memory if allocated.
            GlobalLog.Print(
                "BaseOverlappedAsyncResult#" + Logging.HashString(this) +
                "::ForceReleaseUnmanagedStructures");

            _nativeOverlapped.Dispose();
            _nativeOverlapped = null;
            GC.SuppressFinalize(this);
        }
コード例 #3
0
        private void InternalFree()
        {
            m_Overlapped    = null;
            m_PinnedObjects = null;

            if (m_NativeOverlapped != null)
            {
                if (!m_NativeOverlapped.IsInvalid)
                {
                    m_NativeOverlapped.Dispose();
                }
                m_NativeOverlapped = null;
            }
        }