Example #1
0
 internal IntPtr Remove(IntPtr handle)
 {
     if (handle != IntPtr.Zero)
     {
         int currentHandleCount = 0;
         lock (this)
         {
             this.handleCount--;
             if (this.handleCount < 0)
             {
                 this.handleCount = 0;
             }
             currentHandleCount = this.handleCount;
         }
         lock (HandleCollector.internalSyncObject)
         {
             if (HandleCollector.HandleRemoved != null)
             {
                 HandleCollector.HandleRemoved(this.name, handle, currentHandleCount);
             }
         }
     }
     return(handle);
 }