|
|
102000 |
From 25beefa304af1fa5ce529401ccb19aac252dd185 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
|
|
|
102000 |
Subject: [PATCH 1/3] 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
|
|
|
102000 |
index 10cc25f..70c08ac 100644
|
|
|
102000 |
--- a/govirt/ovirt-proxy.c
|
|
|
102000 |
+++ b/govirt/ovirt-proxy.c
|
|
|
102000 |
@@ -218,6 +218,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 |
|
|
|
102000 |
@@ -282,7 +283,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);
|
|
|
102000 |
--
|
|
|
102000 |
2.9.3
|
|
|
102000 |
|