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



commit 2007c15ef770986f2746fd005f88736ac1749319
Author: Christian Hergert <chergert redhat com>
Date:   Thu May 12 18:31:27 2016 +0300

    clang: don't leak diagnostics

 plugins/clang/ide-clang-diagnostic-provider.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plugins/clang/ide-clang-diagnostic-provider.c b/plugins/clang/ide-clang-diagnostic-provider.c
index 4ad6794..67151d3 100644
--- a/plugins/clang/ide-clang-diagnostic-provider.c
+++ b/plugins/clang/ide-clang-diagnostic-provider.c
@@ -54,7 +54,7 @@ get_translation_unit_cb (GObject      *object,
   IdeClangService *service = (IdeClangService *)object;
   g_autoptr(IdeClangTranslationUnit) tu = NULL;
   g_autoptr(GTask) task = user_data;
-  IdeDiagnostics *diagnostics;
+  g_autoptr(IdeDiagnostics) diagnostics = NULL;
   IdeFile *target;
   GFile *gfile;
   GError *error = NULL;
@@ -76,7 +76,7 @@ get_translation_unit_cb (GObject      *object,
   diagnostics = ide_clang_translation_unit_get_diagnostics_for_file (tu, gfile);
 
   g_task_return_pointer (task,
-                         ide_diagnostics_ref (diagnostics),
+                         g_steal_pointer (&diagnostics),
                          (GDestroyNotify)ide_diagnostics_unref);
 }
 


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