[gnome-builder/wip/libide: 188/237] libide: hold on to context during async operation



commit 49d3be7313c1d53931bd5c29df228f12201d45a1
Author: Christian Hergert <christian hergert me>
Date:   Sat Feb 14 19:49:36 2015 -0800

    libide: hold on to context during async operation

 tools/ide-list-file-settings.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/tools/ide-list-file-settings.c b/tools/ide-list-file-settings.c
index c7cc63c..2ee7876 100644
--- a/tools/ide-list-file-settings.c
+++ b/tools/ide-list-file-settings.c
@@ -29,6 +29,7 @@ static GMainLoop *gMainLoop;
 static gint gExitCode = EXIT_SUCCESS;
 static gchar **gPaths;
 static int gActive;
+static IdeContext *gContext;
 
 static void
 quit (gint exit_code)
@@ -144,6 +145,8 @@ context_cb (GObject      *object,
       g_printerr (_("No files provided to load settings for.\n"));
       quit (EXIT_FAILURE);
     }
+
+  gContext = g_object_ref (context);
 }
 
 gint
@@ -186,6 +189,7 @@ main (gint   argc,
   g_main_loop_run (gMainLoop);
   g_clear_pointer (&gMainLoop, g_main_loop_unref);
   g_strfreev (gPaths);
+  g_clear_object (&gContext);
 
   return gExitCode;
 }


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