menu threaded test: run the mainloop after export
authorRyan Lortie <desrt@desrt.ca>
Thu, 8 Dec 2011 02:10:18 +0000 (21:10 -0500)
committerRyan Lortie <desrt@desrt.ca>
Thu, 8 Dec 2011 23:05:15 +0000 (18:05 -0500)
GDBusConnection now dispatches GDestroyNotify calls back to the
mainloop.  Adding an idle to the mainloop is O(n) in the number of idles
already there.  We therefore need to periodically empty the mainloop to
avoid quadratic behaviour with a very large 'n'.

gio/tests/gmenumodel.c

index 7d5793f..51d1d93 100644 (file)
@@ -754,6 +754,7 @@ do_export (gpointer data)
       id = g_dbus_connection_export_menu_model (bus, path, menu, &error);
       g_assert_no_error (error);
       g_dbus_connection_unexport_menu_model (bus, id);
+      while (g_main_context_iteration (NULL, FALSE));
     }
 
   g_free (path);