Blame SOURCES/0004-proxy-Hold-reference-to-cancellable-object.patch

1bd27f
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
102000
From: "Eduardo Lima (Etrunko)" <etrunko@redhat.com>
102000
Date: Thu, 2 Feb 2017 15:11:42 -0200
1bd27f
Subject: [PATCH] proxy: Hold reference to cancellable object
102000
102000
Being an asynchronous operation, there is no guarantee that the object
102000
is valid by the time of the cleanup, so we hold a reference to it to
102000
ensure it.
102000
102000
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
102000
---
102000
 govirt/ovirt-proxy.c | 3 ++-
102000
 1 file changed, 2 insertions(+), 1 deletion(-)
102000
102000
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c
1bd27f
index efe3284..2b690b6 100644
102000
--- a/govirt/ovirt-proxy.c
102000
+++ b/govirt/ovirt-proxy.c
1bd27f
@@ -220,6 +220,7 @@ static void ovirt_proxy_call_async_data_free(OvirtProxyCallAsyncData *data)
102000
         if ((data->cancellable != NULL) && (data->cancellable_cb_id != 0)) {
102000
             g_cancellable_disconnect(data->cancellable, data->cancellable_cb_id);
102000
         }
102000
+        g_clear_object(&data->cancellable);
102000
         g_slice_free(OvirtProxyCallAsyncData, data);
102000
 }
102000
 
1bd27f
@@ -284,7 +285,7 @@ void ovirt_rest_call_async(OvirtRestCall *call,
102000
     data->call_user_data = user_data;
102000
     data->destroy_call_data = destroy_func;
102000
     if (cancellable != NULL) {
102000
-        data->cancellable = cancellable;
102000
+        data->cancellable = g_object_ref(cancellable);
102000
         data->cancellable_cb_id = g_cancellable_connect(cancellable,
102000
                                                         G_CALLBACK (call_async_cancelled_cb),
102000
                                                         call, NULL);