/// <summary> /// Executes the code required to free the handle. /// </summary> /// <returns><see langword="true"/> if the handle is released successfully; otherwise, in the event of a catastrophic failure, <see langword="false"/>.</returns> protected override bool ReleaseHandle() { bool released; try { Libui.ControlDestroy(this); handle = IntPtr.Zero; released = true; } catch { released = false; } return(released); }