diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-03-25 15:13:43 +0000 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-03-25 15:22:13 +0000 |
commit | f06ca27d72c18f2c77b010a4c1083e56b372f51f (patch) | |
tree | b188b696528dddf494320fdd123afa3b463229ae | |
parent | 7be06a577234e467a82f259b4db81b14c7a801fd (diff) |
ll-connector: free the async result before the connector itself
We need to allow the LL connector to dispose properly by dropping its
last ref held by the GSimpleAsyncResult before actually unreffing
itself.
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r-- | wocky/wocky-ll-connector.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/wocky/wocky-ll-connector.c b/wocky/wocky-ll-connector.c index 76d4057..06ca8a1 100644 --- a/wocky/wocky-ll-connector.c +++ b/wocky/wocky-ll-connector.c @@ -166,9 +166,6 @@ wocky_ll_connector_dispose (GObject *object) g_free (priv->from); priv->from = NULL; - g_object_unref (priv->simple); - priv->simple = NULL; - g_object_unref (priv->cancellable); priv->cancellable = NULL; @@ -319,6 +316,9 @@ features_sent_cb (GObject *source_object, } g_simple_async_result_complete (priv->simple); + g_object_unref (priv->simple); + priv->simple = NULL; + g_object_unref (self); } @@ -344,8 +344,12 @@ recv_open_cb (GObject *source_object, g_simple_async_result_set_error (priv->simple, WOCKY_LL_CONNECTOR_ERROR, WOCKY_LL_CONNECTOR_ERROR_FAILED_TO_RECEIVE_STANZA, "Failed to receive stream open: %s", error->message); - g_simple_async_result_complete (priv->simple); g_clear_error (&error); + + g_simple_async_result_complete (priv->simple); + g_object_unref (priv->simple); + priv->simple = NULL; + g_object_unref (self); return; } @@ -392,8 +396,12 @@ send_open_cb (GObject *source_object, g_simple_async_result_set_error (priv->simple, WOCKY_LL_CONNECTOR_ERROR, WOCKY_LL_CONNECTOR_ERROR_FAILED_TO_SEND_STANZA, "Failed to send stream open: %s", error->message); - g_simple_async_result_complete (priv->simple); g_clear_error (&error); + + g_simple_async_result_complete (priv->simple); + g_object_unref (priv->simple); + priv->simple = NULL; + g_object_unref (self); return; } |