[gnome-font-viewer] font-view: make sure to hold the GApplication while doing async init



commit 5650a8f6e59f005a56d14c4c6b94f60db81b7211
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed May 17 12:11:17 2017 -0700

    font-view: make sure to hold the GApplication while doing async init
    
    Otherwise the application will shutdown during the query_info call.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782738

 src/font-view.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/font-view.c b/src/font-view.c
index 898e53b..21aebf4 100644
--- a/src/font-view.c
+++ b/src/font-view.c
@@ -737,6 +737,8 @@ query_info_ready_cb (GObject *object,
     GFileInfo *info;
     GError *error = NULL;
 
+    g_application_release (G_APPLICATION (self));
+
     info = g_file_query_info_finish (G_FILE (object), res, &error);
     if (error != NULL) {
         font_view_application_do_overview (self);
@@ -756,6 +758,8 @@ font_view_application_open (GApplication *application,
                             const gchar *hint)
 {
     FontViewApplication *self = FONT_VIEW_APPLICATION (application);
+
+    g_application_hold (application);
     g_file_query_info_async (files[0], G_FILE_ATTRIBUTE_STANDARD_NAME,
                              G_FILE_QUERY_INFO_NONE,
                              G_PRIORITY_DEFAULT, NULL,


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