diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2009-06-01 23:14:07 +0800 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2009-06-01 23:55:34 +0800 |
commit | e2fa5b38c29e8b2c1572ff477ef602b739791f57 (patch) | |
tree | c6a5d905dcad49451ec3db0dae04624863295f30 /libempathy/empathy-ft-handler.c | |
parent | 5a321202dfaa506c8f6e75a9389d4cdb5b8f6619 (diff) | |
download | gsoc2013-empathy-e2fa5b38c29e8b2c1572ff477ef602b739791f57.tar gsoc2013-empathy-e2fa5b38c29e8b2c1572ff477ef602b739791f57.tar.gz gsoc2013-empathy-e2fa5b38c29e8b2c1572ff477ef602b739791f57.tar.bz2 gsoc2013-empathy-e2fa5b38c29e8b2c1572ff477ef602b739791f57.tar.lz gsoc2013-empathy-e2fa5b38c29e8b2c1572ff477ef602b739791f57.tar.xz gsoc2013-empathy-e2fa5b38c29e8b2c1572ff477ef602b739791f57.tar.zst gsoc2013-empathy-e2fa5b38c29e8b2c1572ff477ef602b739791f57.zip |
Free the cb_data after errors in construction
Diffstat (limited to 'libempathy/empathy-ft-handler.c')
-rw-r--r-- | libempathy/empathy-ft-handler.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libempathy/empathy-ft-handler.c b/libempathy/empathy-ft-handler.c index 5b6f97b78..ba81fd4c7 100644 --- a/libempathy/empathy-ft-handler.c +++ b/libempathy/empathy-ft-handler.c @@ -1088,6 +1088,7 @@ find_ft_channel_classes_cb (GList *channel_classes, { CallbacksData *data = user_data; EmpathyFTHandler *handler = data->handler; + EmpathyFTHandlerPriv *priv = GET_PRIV (handler); GError *myerr = NULL; if (channel_classes == NULL) @@ -1096,6 +1097,9 @@ find_ft_channel_classes_cb (GList *channel_classes, EMPATHY_FT_ERROR_NOT_SUPPORTED, _("File transfer not supported by remote contact")); + if (!g_cancellable_is_cancelled (priv->cancellable)) + g_cancellable_cancel (priv->cancellable); + data->callback (handler, myerr, data->user_data); g_clear_error (&myerr); } @@ -1161,9 +1165,8 @@ out: if (!g_cancellable_is_cancelled (priv->cancellable)) g_cancellable_cancel (priv->cancellable); - cb_data->callback (NULL, error, cb_data->user_data); + cb_data->callback (cb_data->handler, error, cb_data->user_data); g_error_free (error); - g_object_unref (cb_data->handler); callbacks_data_free (cb_data); } @@ -1194,8 +1197,8 @@ contact_factory_contact_cb (EmpathyTpContactFactory *factory, if (!g_cancellable_is_cancelled (priv->cancellable)) g_cancellable_cancel (priv->cancellable); - cb_data->callback (NULL, (GError *) error, cb_data->user_data); - g_object_unref (handler); + cb_data->callback (handler, (GError *) error, cb_data->user_data); + callbacks_data_free (cb_data); return; } @@ -1222,8 +1225,9 @@ channel_get_all_properties_cb (TpProxy *proxy, if (!g_cancellable_is_cancelled (priv->cancellable)) g_cancellable_cancel (priv->cancellable); - cb_data->callback (NULL, (GError *) error, cb_data->user_data); - g_object_unref (handler); + cb_data->callback (handler, (GError *) error, cb_data->user_data); + + callbacks_data_free (cb_data); return; } |