Commit 595bb7f5 authored by Zeeshan Ali's avatar Zeeshan Ali

lib: Clear the task pointer when unrefing

Don't just unref the task pointer but ensure that the pointer we keep in
private structure is also cleared, using g_clear_object.
parent 47f146d5
...@@ -284,8 +284,10 @@ on_client_started (GObject *source_object, ...@@ -284,8 +284,10 @@ on_client_started (GObject *source_object,
gclue_client_call_start_finish (client, res, &error); gclue_client_call_start_finish (client, res, &error);
if (error != NULL) { if (error != NULL) {
GClueSimple *simple = g_task_get_source_object (task);
g_task_return_error (task, error); g_task_return_error (task, error);
g_object_unref (task); g_clear_object (&simple->priv->task);
} }
} }
...@@ -302,7 +304,7 @@ on_client_created (GObject *source_object, ...@@ -302,7 +304,7 @@ on_client_created (GObject *source_object,
priv->client = gclue_client_proxy_create_finish (res, &error); priv->client = gclue_client_proxy_create_finish (res, &error);
if (error != NULL) { if (error != NULL) {
g_task_return_error (task, error); g_task_return_error (task, error);
g_object_unref (task); g_clear_object (&priv->task);
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment