protected override bool ReleaseHandle() { bool released = false; if (!this.IsInvalid) { System.IntPtr release = this.handle; this.handle = System.IntPtr.Zero; XenStoreFunctions.xs2_free(release); released = true; } return released; }
protected override bool ReleaseHandle() { // Seems like when disposing, IsClosed is true, even though we're in the middle of releasing... bool released = this.IsInvalid; if (!released) // If valid handle { System.IntPtr release = this.handle; this.handle = System.IntPtr.Zero; XenStoreFunctions.xs2_free(release); released = true; } // Ends if valid handle return released; }