[anjuta] symbol-db: Keep a reference to the SymbolDBQuery when running it in a thread.
- From: Massimo Cora' <mcora src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] symbol-db: Keep a reference to the SymbolDBQuery when running it in a thread.
- Date: Wed, 21 Nov 2012 22:55:15 +0000 (UTC)
commit 0d675b2b3b2536d5fc8f6b237ebf800629a51ad7
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date: Mon Nov 19 17:57:16 2012 +0100
symbol-db: Keep a reference to the SymbolDBQuery when running it in a thread.
This fixes a crasher where the SymbolDBQuery was finalized before all the started threads had
finished. It also caused the warning in symbol-db-query.c:826 to be printed.
https://bugzilla.gnome.org/show_bug.cgi?id=688658
plugins/symbol-db/symbol-db-query.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/plugins/symbol-db/symbol-db-query.c b/plugins/symbol-db/symbol-db-query.c
index 8346fd1..f445ce8 100644
--- a/plugins/symbol-db/symbol-db-query.c
+++ b/plugins/symbol-db/symbol-db-query.c
@@ -608,6 +608,8 @@ sdb_query_async_run (gpointer data)
queue = priv->async_result_queue;
g_async_queue_push (queue, sdb_query_execute_real (query));
g_async_queue_unref (queue);
+
+ g_object_unref (query);
return 0;
}
@@ -711,7 +713,8 @@ sdb_query_execute (SymbolDBQuery *query)
query->priv->async_poll_id =
g_idle_add (on_sdb_query_async_poll, query);
}
- g_thread_create (sdb_query_async_run, query, FALSE, NULL);
+ g_thread_new ("SymbolDBQuery Thread", sdb_query_async_run,
+ g_object_ref (query));
return NULL;
case IANJUTA_SYMBOL_QUERY_MODE_QUEUED:
query->priv->query_queued = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]