[gnome-builder] code-index: reference build data when storing to queue
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] code-index: reference build data when storing to queue
- Date: Thu, 18 Jan 2018 14:45:18 +0000 (UTC)
commit 879ed40a01982be30aa84f87c303fe3fff408603
Author: Christian Hergert <chergert redhat com>
Date: Thu Jan 18 06:37:20 2018 -0800
code-index: reference build data when storing to queue
src/plugins/code-index/ide-code-index-service.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/code-index/ide-code-index-service.c b/src/plugins/code-index/ide-code-index-service.c
index 9c5128551..a416d4684 100644
--- a/src/plugins/code-index/ide-code-index-service.c
+++ b/src/plugins/code-index/ide-code-index-service.c
@@ -88,6 +88,15 @@ build_data_unref (BuildData *data)
}
}
+static BuildData *
+build_data_ref (BuildData *data)
+{
+ g_assert (data != NULL);
+ g_assert (data->ref_count > 0);
+ g_atomic_int_inc (&data->ref_count);
+ return data;
+}
+
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BuildData, build_data_unref)
static void
@@ -220,7 +229,6 @@ ide_code_index_service_build_cb (GObject *object,
else
{
unregister_pausable (self);
- ide_code_index_builder_drop_caches (builder);
}
}
@@ -234,7 +242,7 @@ ide_code_index_serivce_push (BuildData *bdata)
if (g_queue_is_empty (&bdata->self->build_queue))
{
- g_queue_push_tail (&bdata->self->build_queue, bdata);
+ g_queue_push_tail (&bdata->self->build_queue, build_data_ref (bdata));
g_clear_object (&bdata->self->cancellable);
bdata->self->cancellable = g_cancellable_new ();
@@ -250,7 +258,7 @@ ide_code_index_serivce_push (BuildData *bdata)
}
else
{
- g_queue_push_tail (&bdata->self->build_queue, bdata);
+ g_queue_push_tail (&bdata->self->build_queue, build_data_ref (bdata));
}
if (bdata->self->build_dirs != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]