[gnome-builder] code-index: try harder to cleanup incremental state
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] code-index: try harder to cleanup incremental state
- Date: Tue, 31 Jul 2018 00:44:25 +0000 (UTC)
commit 3b3cc4ccf4daaa1f7dc220d729552d54e9f504c9
Author: Christian Hergert <chergert redhat com>
Date: Mon Jul 30 17:43:20 2018 -0700
code-index: try harder to cleanup incremental state
src/plugins/code-index/ide-code-index-builder.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/src/plugins/code-index/ide-code-index-builder.c b/src/plugins/code-index/ide-code-index-builder.c
index 7bb6b5cd9..0ebb42374 100644
--- a/src/plugins/code-index/ide-code-index-builder.c
+++ b/src/plugins/code-index/ide-code-index-builder.c
@@ -661,7 +661,7 @@ get_changes_worker (IdeTask *task,
g_assert (IDE_IS_VCS (gcd->vcs));
if (ide_task_return_error_if_cancelled (task))
- return;
+ goto cancelled;
/*
* If we are recursive, collect all the directories we need to look
@@ -682,7 +682,7 @@ get_changes_worker (IdeTask *task,
to_update = g_ptr_array_new_with_free_func (g_object_unref);
if (ide_task_return_error_if_cancelled (task))
- return;
+ goto cancelled;
/*
* Process directories to check for changes, while ensuring we have not
@@ -720,9 +720,11 @@ get_changes_worker (IdeTask *task,
g_queue_clear (&files);
if (ide_task_return_error_if_cancelled (task))
- return;
+ goto cancelled;
}
+cancelled:
+
/* In case we were cancelled */
if (gcd->directories.length > 0)
{
@@ -731,13 +733,17 @@ get_changes_worker (IdeTask *task,
}
g_assert (gcd->directories.length == 0);
- g_assert (IDE_IS_VCS (gcd->vcs));
- g_assert (G_IS_FILE (gcd->data_dir));
- g_assert (G_IS_FILE (gcd->index_dir));
- ide_task_return_pointer (task,
- g_steal_pointer (&to_update),
- (GDestroyNotify) g_ptr_array_unref);
+ if (!ide_task_had_error (task))
+ {
+ g_assert (IDE_IS_VCS (gcd->vcs));
+ g_assert (G_IS_FILE (gcd->data_dir));
+ g_assert (G_IS_FILE (gcd->index_dir));
+
+ ide_task_return_pointer (task,
+ g_steal_pointer (&to_update),
+ (GDestroyNotify)g_ptr_array_unref);
+ }
}
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]