public static void QuitMainLoop () { if (mainloop != null && mainloop.IsRunning) { mainloop.Quit (); } } }