[gnome-builder] clang: only return result set once
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] clang: only return result set once
- Date: Mon, 26 Mar 2018 00:17:53 +0000 (UTC)
commit f7f7e5647970a2f4c4a5e53f8a51d2806e2b89d4
Author: Christian Hergert <chergert redhat com>
Date: Sun Mar 25 17:17:14 2018 -0700
clang: only return result set once
We exhaust the information structures after the first call. So no need to
return anything on follow up calls.
src/plugins/clang/ide-clang-code-index-entries.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/clang/ide-clang-code-index-entries.c
b/src/plugins/clang/ide-clang-code-index-entries.c
index 8fcb66f85..9f565816c 100644
--- a/src/plugins/clang/ide-clang-code-index-entries.c
+++ b/src/plugins/clang/ide-clang-code-index-entries.c
@@ -55,6 +55,9 @@ struct _IdeClangCodeIndexEntries
/* Path to the file that has been parsed. */
gchar *path;
+
+ /* If we've already run once, (so return empty result). */
+ guint has_run : 1;
};
static void
@@ -376,7 +379,15 @@ ide_clang_code_index_entries_next_entries_async (IdeCodeIndexEntries *entries,
ide_task_set_source_tag (task, ide_clang_code_index_entries_next_entries_async);
ide_task_set_priority (task, G_PRIORITY_LOW + 1000);
ide_task_set_kind (task, IDE_TASK_KIND_INDEXER);
- ide_task_run_in_thread (task, ide_clang_code_index_entries_worker);
+
+ if (self->has_run)
+ ide_task_return_pointer (task,
+ g_ptr_array_new_with_free_func ((GDestroyNotify)ide_code_index_entry_free),
+ (GDestroyNotify)g_ptr_array_unref);
+ else
+ ide_task_run_in_thread (task, ide_clang_code_index_entries_worker);
+
+ self->has_run = TRUE;
}
static GPtrArray *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]