GApplication: don't iterate further on _quit()
authorRyan Lortie <desrt@desrt.ca>
Fri, 27 Feb 2015 12:50:28 +0000 (07:50 -0500)
committerRyan Lortie <desrt@desrt.ca>
Mon, 2 Mar 2015 16:55:33 +0000 (11:55 -0500)
If someone explicitly calls g_application_quit() then don't attempt to
drain the mainloop of remaining sources.

This allows applications with 100% CPU utilisation to quit reliably.

https://bugzilla.gnome.org/show_bug.cgi?id=744876

gio/gapplication.c

index 1fe12e9..c72ff53 100644 (file)
@@ -2324,8 +2324,9 @@ g_application_run (GApplication  *application,
 
   g_settings_sync ();
 
-  while (g_main_context_iteration (NULL, FALSE))
-    ;
+  if (!application->priv->must_quit_now)
+    while (g_main_context_iteration (NULL, FALSE))
+      ;
 
   return status;
 }