[jsonrpc-glib] client: hold reference to self during sync call
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [jsonrpc-glib] client: hold reference to self during sync call
- Date: Wed, 27 Dec 2017 11:39:20 +0000 (UTC)
commit 7d865a0c0d84b2e04271888c2a339397d4717834
Author: Christian Hergert <chergert redhat com>
Date: Wed Dec 27 03:25:09 2017 -0800
client: hold reference to self during sync call
This ensures that we hold an extra reference to self during the process,
as we might lose our reference when the connection is closed.
src/jsonrpc-client.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/jsonrpc-client.c b/src/jsonrpc-client.c
index 383e46e..c73eff1 100644
--- a/src/jsonrpc-client.c
+++ b/src/jsonrpc-client.c
@@ -847,7 +847,7 @@ jsonrpc_client_call (JsonrpcClient *self,
main_context = g_main_context_ref_thread_default ();
- task = g_task_new (NULL, NULL, NULL, NULL);
+ task = g_task_new (self, NULL, NULL, NULL);
g_task_set_source_tag (task, jsonrpc_client_call);
jsonrpc_client_call_async (self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]