[jsonrpc-glib] client: hold reference to self during sync call



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]