[glib/wip/gcleanup: 64/71] gdbus-example-export: Fix behavior when using cleanup



commit d98ccb249faeddd05fc58c409621ce0feca8f24c
Author: Stef Walter <stefw gnome org>
Date:   Sat Nov 9 20:22:30 2013 +0100

    gdbus-example-export: Fix behavior when using cleanup
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711799

 gio/tests/gdbus-example-export.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gio/tests/gdbus-example-export.c b/gio/tests/gdbus-example-export.c
index 5bb74d0..a029df4 100644
--- a/gio/tests/gdbus-example-export.c
+++ b/gio/tests/gdbus-example-export.c
@@ -290,19 +290,20 @@ on_name_acquired (GDBusConnection *connection,
 {
 }
 
+static GMainLoop *loop;
+
 static void
 on_name_lost (GDBusConnection *connection,
               const gchar     *name,
               gpointer         user_data)
 {
-  exit (1);
+  g_main_loop_quit (user_data);
 }
 
 int
 main (int argc, char *argv[])
 {
   guint owner_id;
-  GMainLoop *loop;
   MyObject *myobj;
 
   /* We are lazy here - we don't want to manually provide
@@ -331,6 +332,7 @@ main (int argc, char *argv[])
   g_dbus_node_info_unref (introspection_data);
 
   g_object_unref (myobj);
+  g_main_loop_unref (loop);
 
   return 0;
 }


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