[gtk+] widget-factory: Clean up on shutdown



commit e8da5ec916588e3f02ccafab1a5afc6b669c69ed
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Apr 12 22:13:14 2014 -0700

    widget-factory: Clean up on shutdown

 demos/widget-factory/widget-factory.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c
index 21ff514..937dc63 100644
--- a/demos/widget-factory/widget-factory.c
+++ b/demos/widget-factory/widget-factory.c
@@ -287,8 +287,7 @@ main (int argc, char *argv[])
     { "about", activate_about, NULL, NULL, NULL },
     { "quit", activate_quit, NULL, NULL, NULL },
   };
-
-  gtk_init (&argc, &argv);
+  gint status;
 
   app = gtk_application_new ("org.gtk.WidgetFactory", 0);
 
@@ -299,7 +298,8 @@ main (int argc, char *argv[])
   g_signal_connect (app, "startup", G_CALLBACK (startup), NULL);
   g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
 
-  g_application_run (G_APPLICATION (app), argc, argv);
+  status = g_application_run (G_APPLICATION (app), argc, argv);
+  g_object_unref (app);
 
-  return 0;
+  return status;
 }


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