[gnome-builder] codeindex: make next_entries_finish() transfer-full
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] codeindex: make next_entries_finish() transfer-full
- Date: Mon, 9 Apr 2018 23:22:11 +0000 (UTC)
commit 1756df6de5f2abb7a63b5b5366a84d3113bfa40a
Author: Christian Hergert <chergert redhat com>
Date: Mon Apr 9 16:21:36 2018 -0700
codeindex: make next_entries_finish() transfer-full
src/libide/symbols/ide-code-index-entries.c | 9 +++++++--
src/plugins/clang/ide-clang-code-index-entries.c | 6 +++++-
src/plugins/code-index/ide-code-index-builder.c | 1 +
src/plugins/vala-pack/ide-vala-code-indexer.vala | 2 +-
4 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/src/libide/symbols/ide-code-index-entries.c b/src/libide/symbols/ide-code-index-entries.c
index 5573e1596..00808553a 100644
--- a/src/libide/symbols/ide-code-index-entries.c
+++ b/src/libide/symbols/ide-code-index-entries.c
@@ -23,6 +23,7 @@
#include "application/ide-application.h"
#include "symbols/ide-code-index-entries.h"
#include "threading/ide-task.h"
+#include "util/ide-glib.h"
G_DEFINE_INTERFACE (IdeCodeIndexEntries, ide_code_index_entries, G_TYPE_OBJECT)
@@ -58,10 +59,14 @@ ide_code_index_entries_real_next_entries_finish (IdeCodeIndexEntries *self,
GAsyncResult *result,
GError **error)
{
+ GPtrArray *ret;
+
g_assert (IDE_IS_CODE_INDEX_ENTRIES (self));
g_assert (IDE_IS_TASK (result));
- return ide_task_propagate_pointer (IDE_TASK (result), error);
+ ret = ide_task_propagate_pointer (IDE_TASK (result), error);
+
+ return IDE_PTR_ARRAY_STEAL_FULL (&ret);
}
static IdeCodeIndexEntry *
@@ -150,7 +155,7 @@ ide_code_index_entries_next_entries_async (IdeCodeIndexEntries *self,
*
* Completes an asynchronous request for the next set of entries from the index.
*
- * Returns: (transfer container) (element-type Ide.CodeIndexEntry): a #GPtrArray
+ * Returns: (transfer full) (element-type Ide.CodeIndexEntry): a #GPtrArray
* of #IdeCodeIndexEntry.
*
* Since: 3.30
diff --git a/src/plugins/clang/ide-clang-code-index-entries.c
b/src/plugins/clang/ide-clang-code-index-entries.c
index 9f565816c..9d2fa92a1 100644
--- a/src/plugins/clang/ide-clang-code-index-entries.c
+++ b/src/plugins/clang/ide-clang-code-index-entries.c
@@ -395,11 +395,15 @@ ide_clang_code_index_entries_next_entries_finish (IdeCodeIndexEntries *entries,
GAsyncResult *result,
GError **error)
{
+ GPtrArray *ret;
+
g_assert (IDE_IS_CLANG_CODE_INDEX_ENTRIES (entries));
g_assert (IDE_IS_TASK (result));
g_assert (ide_task_is_valid (result, entries));
- return ide_task_propagate_pointer (IDE_TASK (result), error);
+ ret = ide_task_propagate_pointer (IDE_TASK (result), error);
+
+ return IDE_PTR_ARRAY_STEAL_FULL (&ret);
}
static void
diff --git a/src/plugins/code-index/ide-code-index-builder.c b/src/plugins/code-index/ide-code-index-builder.c
index 3d808942a..6ce994816 100644
--- a/src/plugins/code-index/ide-code-index-builder.c
+++ b/src/plugins/code-index/ide-code-index-builder.c
@@ -941,6 +941,7 @@ add_entries_to_index_next_entries_cb (GObject *object,
g_assert (IDE_IS_TASK (task));
ret = ide_code_index_entries_next_entries_finish (entries, result, &error);
+ IDE_PTR_ARRAY_SET_FREE_FUNC (ret, ide_code_index_entry_free);
if (error != NULL)
{
diff --git a/src/plugins/vala-pack/ide-vala-code-indexer.vala
b/src/plugins/vala-pack/ide-vala-code-indexer.vala
index ad91a3b1b..02dcf0484 100644
--- a/src/plugins/vala-pack/ide-vala-code-indexer.vala
+++ b/src/plugins/vala-pack/ide-vala-code-indexer.vala
@@ -99,7 +99,7 @@ namespace Ide
return null;
}
- public async GLib.GenericArray<weak Ide.CodeIndexEntry> next_entries_async (GLib.Cancellable?
cancellable)
+ public async GLib.GenericArray<Ide.CodeIndexEntry> next_entries_async (GLib.Cancellable? cancellable)
throws GLib.Error
{
var ret = new GLib.GenericArray<Ide.CodeIndexEntry> ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]