[gnome-builder/wip/libide: 114/153] libide: return translation unit via task



commit 2caaabe8aa79334c0ecf3f82457d98b1eff8fe96
Author: Christian Hergert <christian hergert me>
Date:   Wed Feb 11 22:17:15 2015 -0800

    libide: return translation unit via task

 libide/clang/ide-clang-service.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/libide/clang/ide-clang-service.c b/libide/clang/ide-clang-service.c
index f581d61..2e0d6a8 100644
--- a/libide/clang/ide-clang-service.c
+++ b/libide/clang/ide-clang-service.c
@@ -74,7 +74,7 @@ ide_clang_service_parse_worker (GTask        *task,
                                 GCancellable *cancellable)
 {
   IdeClangServicePrivate *priv;
-  IdeClangTranslationUnit *ret;
+  g_autoptr(IdeClangTranslationUnit) ret = NULL;
   CXTranslationUnit tu = NULL;
   ParseRequest *request = task_data;
   IdeContext *context;
@@ -166,6 +166,8 @@ ide_clang_service_parse_worker (GTask        *task,
                         g_object_ref (ret));
   g_rw_lock_writer_unlock (&priv->cached_rwlock);
 
+  g_task_return_pointer (task, g_object_ref (ret), g_object_unref);
+
 cleanup:
   g_array_unref (ar);
 }


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