public void HandleKeyPress(XKeyEvent e, XWindow window, XWindow root, XWindow subwindow) { if (Convert.ToBoolean(main_win.LookupKeysym(ref e) == XKeySym.XK_q)) { Console.WriteLine("Cleaning up and exiting..."); //pix.Free (); gc.Dispose(); bg_color.Dispose(); handle_color.Dispose(); resize_top_left_win.Dispose(); resize_top_right_win.Dispose(); resize_bottom_left_win.Dispose(); resize_bottom_right_win.Dispose(); resize_main_win.Dispose(); main_win.Dispose(); ev.Dispose(); s.Dispose(); dpy.Dispose(); Environment.Exit(0); } }
public void DestroyEx() { xeventsRunner = false; GC.Dispose(); this.Dispose(); xevents.Dispose(); Screen.Dispose(); Display.Dispose(); if (WindowsThread != null) { if (WindowsThread.IsAlive) { try { WindowsThread.Join(1000); } catch { WindowsThread.Abort(); } WindowsThread = null; } } }