[gnome-builder] clang: don't leak completion proposals
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] clang: don't leak completion proposals
- Date: Mon, 28 Sep 2015 01:24:44 +0000 (UTC)
commit a86f3bcfa1dc9110c6bd04f524ead7044fc328d8
Author: Christian Hergert <christian hergert me>
Date: Sun Sep 27 18:24:20 2015 -0700
clang: don't leak completion proposals
plugins/clang/ide-clang-translation-unit.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/plugins/clang/ide-clang-translation-unit.c b/plugins/clang/ide-clang-translation-unit.c
index 0d77893..9faa31c 100644
--- a/plugins/clang/ide-clang-translation-unit.c
+++ b/plugins/clang/ide-clang-translation-unit.c
@@ -632,7 +632,7 @@ ide_clang_translation_unit_code_complete_worker (GTask *task,
CXTranslationUnit tu;
g_autoptr(IdeRefPtr) refptr = NULL;
struct CXUnsavedFile *ufs;
- g_autoptr(GPtrArray) ar = NULL;
+ GPtrArray *ar;
gsize i;
gsize j = 0;
@@ -698,7 +698,7 @@ ide_clang_translation_unit_code_complete_worker (GTask *task,
* we will inflate result strings as necessary.
*/
refptr = ide_ref_ptr_new (results, (GDestroyNotify)clang_disposeCodeCompleteResults);
- ar = g_ptr_array_new ();
+ ar = g_ptr_array_new_with_free_func (g_object_unref);
for (i = 0; i < results->NumResults; i++)
{
@@ -708,7 +708,7 @@ ide_clang_translation_unit_code_complete_worker (GTask *task,
g_ptr_array_add (ar, proposal);
}
- g_task_return_pointer (task, g_ptr_array_ref (ar), (GDestroyNotify)g_ptr_array_unref);
+ g_task_return_pointer (task, ar, (GDestroyNotify)g_ptr_array_unref);
/* cleanup malloc'd state */
for (i = 0; i < j; i++)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]