diff options
-rw-r--r-- | shell/ChangeLog | 9 | ||||
-rw-r--r-- | shell/e-component-registry.c | 26 |
2 files changed, 34 insertions, 1 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 78870b7c9a..16672025ae 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,5 +1,14 @@ 2001-10-30 Ettore Perazzoli <ettore@ximian.com> + * e-component-registry.c (sleep_with_g_main_loop): New utility + function. + (sleep_with_g_main_loop_timeout_callback): Callback function for + `sleep_with_g_main_loop()'. + (wait_for_corba_object_to_die): Use `sleep_with_g_main_loop()' + instead of `sleep()'. + +2001-10-30 Ettore Perazzoli <ettore@ximian.com> + * main.c (development_warning): Removed. (idle_cb): Don't call it. (warning_dialog_clicked_callback): Removed. diff --git a/shell/e-component-registry.c b/shell/e-component-registry.c index 07762ac9e5..77e2df95eb 100644 --- a/shell/e-component-registry.c +++ b/shell/e-component-registry.c @@ -60,6 +60,30 @@ struct _EComponentRegistryPrivate { /* Utility functions. */ +static int +sleep_with_g_main_loop_timeout_callback (void *data) +{ + GMainLoop *loop; + + loop = (GMainLoop *) data; + g_main_quit (loop); + + return FALSE; +} + +/* This function is like `sleep()', but it uses the GMainLoop so CORBA + invocations can get through. */ +static void +sleep_with_g_main_loop (int num_seconds) +{ + GMainLoop *loop; + + loop = g_main_new (TRUE); + g_timeout_add (1000 * num_seconds, sleep_with_g_main_loop_timeout_callback, loop); + g_main_run (loop); + g_main_destroy (loop); +} + static void wait_for_corba_object_to_die (Bonobo_Unknown corba_objref, const char *id) @@ -74,7 +98,7 @@ wait_for_corba_object_to_die (Bonobo_Unknown corba_objref, break; g_print ("Waiting for component to die -- %s (%d)\n", id, count); - sleep (1); + sleep_with_g_main_loop (1); count ++; } } |