private void Dispose(bool disposing) { var handle = Interlocked.Exchange(ref _handle, IntPtr.Zero); if (IsOwner && handle != IntPtr.Zero) // only dispose undisposed objects that we own { Interop.FreeNamedColorList(handle); Context = null; } }
/// <summary> /// Frees the named color list handle. /// </summary> protected override bool ReleaseHandle() { Interop.FreeNamedColorList(handle); return(true); }