[glib/wip/gcleanup: 73/78] gdbus-testserver: Fix behavior during cleanup



commit 78cce97f2b068539bed99ba6db7b446eaf7f6f7b
Author: Stef Walter <stefw gnome org>
Date:   Sat Nov 9 20:24:27 2013 +0100

    gdbus-testserver: Fix behavior during cleanup
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711799

 gio/tests/gdbus-testserver.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gio/tests/gdbus-testserver.c b/gio/tests/gdbus-testserver.c
index 7f99a19..f116b27 100644
--- a/gio/tests/gdbus-testserver.c
+++ b/gio/tests/gdbus-testserver.c
@@ -834,7 +834,7 @@ on_name_lost (GDBusConnection *connection,
               const gchar     *name,
               gpointer         user_data)
 {
-  exit (1);
+  g_main_loop_quit (user_data);
 }
 
 int
@@ -869,16 +869,17 @@ main (int argc, char *argv[])
   g_hash_table_insert (properties, g_strdup ("foo"), g_variant_ref_sink (g_variant_new_string ("a frobbed 
string")));
   g_hash_table_insert (properties, g_strdup ("PropertyThatWillBeInvalidated"), g_variant_ref_sink 
(g_variant_new_string ("InitialValue")));
 
+  loop = g_main_loop_new (NULL, FALSE);
+
   owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
                              "com.example.TestService",
                              G_BUS_NAME_OWNER_FLAGS_NONE,
                              on_bus_acquired,
                              on_name_acquired,
                              on_name_lost,
-                             NULL,
+                             loop,
                              NULL);
 
-  loop = g_main_loop_new (NULL, FALSE);
   g_main_loop_run (loop);
 
   g_bus_unown_name (owner_id);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]