[gnome-builder/gnome-builder-3-20] gettext: don't leak diagnostics



commit 1c5664930fd246bdf15f4a7dd6b11d9dcc57cb47
Author: Christian Hergert <chergert redhat com>
Date:   Thu May 12 17:45:09 2016 +0300

    gettext: don't leak diagnostics

 plugins/gettext/ide-gettext-diagnostic-provider.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/plugins/gettext/ide-gettext-diagnostic-provider.c 
b/plugins/gettext/ide-gettext-diagnostic-provider.c
index 4958d05..7697f54 100644
--- a/plugins/gettext/ide-gettext-diagnostic-provider.c
+++ b/plugins/gettext/ide-gettext-diagnostic-provider.c
@@ -271,6 +271,7 @@ subprocess_wait_cb (GObject      *source_object,
 {
   GSubprocess *subprocess = G_SUBPROCESS (source_object);
   g_autoptr(GTask) task = user_data;
+  g_autoptr(IdeDiagnostics) local_diags = NULL;
   TranslationUnit *unit = g_task_get_task_data (task);
   GPtrArray *array = NULL;
   IdeGettextDiagnostics *diags;
@@ -330,8 +331,9 @@ subprocess_wait_cb (GObject      *source_object,
     }
 
  out:
+  local_diags = ide_diagnostics_new (array);
   diags = g_object_new (IDE_TYPE_GETTEXT_DIAGNOSTICS,
-                        "diagnostics", ide_diagnostics_new (array),
+                        "diagnostics", local_diags,
                         "sequence", ide_unsaved_file_get_sequence (unit->unsaved_file),
                         NULL);
   g_task_return_pointer (task, diags, g_object_unref);


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