Exemplo n.º 1
0
 /// <summary>
 /// This is going to mess up any ref counting,
 /// but allows a handle that's due for disposal to give up its resource.
 /// </summary>
 /// <returns>New handle holding the released resource.</returns>
 public NMessageHandle.UdbusMessageHandle Release()
 {
     NMessageHandle.UdbusMessageHandle copy = new UdbusMessageHandle();
     if (this.IsClosed || this.IsInvalid) // If not a valid handle
     {
         copy.handle = this.handle;
     }
     else
     {
         IntPtr handleTemp = this.handle;
         base.SetHandleAsInvalid();
         this.handle = IntPtr.Zero;
         copy.SetHandle(handleTemp);
     }
     return(copy);
 }
Exemplo n.º 2
0
 /// <summary>
 /// This is going to mess up any ref counting,
 /// but allows a handle that's due for disposal to give up its resource.
 /// </summary>
 /// <returns>New handle holding the released resource.</returns>
 public NMessageHandle.UdbusMessageHandle Release()
 {
     NMessageHandle.UdbusMessageHandle copy = new UdbusMessageHandle();
     if (this.IsClosed || this.IsInvalid) // If not a valid handle
     {
         copy.handle = this.handle;
     }
     else
     {
         IntPtr handleTemp = this.handle;
         base.SetHandleAsInvalid();
         this.handle = IntPtr.Zero;
         copy.SetHandle(handleTemp);
     }
     return copy;
 }