protected override void Destroy() { //only destroy if brush is created by us if (!mSystemBrush) { if (hBrush != (IntPtr) 0) NativeMethods.DeleteObject(hBrush); } base.Destroy(); hBrush = (IntPtr) 0; } }