aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-01-10 00:15:10 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-10 00:15:10 +0800
commitac3d19d800cc16b24615e82b6b351f880c13d710 (patch)
tree7ea8980ee847a076159923d269b4c80ca73834a0
parent2e78b7d4c7756864fba8b6024ad85b0f02ec5e0a (diff)
downloadgsoc2013-empathy-ac3d19d800cc16b24615e82b6b351f880c13d710.tar
gsoc2013-empathy-ac3d19d800cc16b24615e82b6b351f880c13d710.tar.gz
gsoc2013-empathy-ac3d19d800cc16b24615e82b6b351f880c13d710.tar.bz2
gsoc2013-empathy-ac3d19d800cc16b24615e82b6b351f880c13d710.tar.lz
gsoc2013-empathy-ac3d19d800cc16b24615e82b6b351f880c13d710.tar.xz
gsoc2013-empathy-ac3d19d800cc16b24615e82b6b351f880c13d710.tar.zst
gsoc2013-empathy-ac3d19d800cc16b24615e82b6b351f880c13d710.zip
Don't close channels as a side-effect of disposing wrapper objects
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> svn path=/trunk/; revision=2183
-rw-r--r--libempathy/empathy-tp-call.c13
-rw-r--r--libempathy/empathy-tp-chat.c7
-rw-r--r--libempathy/empathy-tp-file.c5
3 files changed, 19 insertions, 6 deletions
diff --git a/libempathy/empathy-tp-call.c b/libempathy/empathy-tp-call.c
index 22c86232a..65c09ce65 100644
--- a/libempathy/empathy-tp-call.c
+++ b/libempathy/empathy-tp-call.c
@@ -478,7 +478,7 @@ tp_call_constructor (GType type,
return object;
}
-static void
+static void
tp_call_finalize (GObject *object)
{
EmpathyTpCallPriv *priv = GET_PRIV (object);
@@ -489,9 +489,18 @@ tp_call_finalize (GObject *object)
g_slice_free (EmpathyTpCallStream, priv->video);
g_object_unref (priv->group);
+ if (priv->group != NULL)
+ g_object_unref (priv->group);
+
+ priv->group = NULL;
+
if (priv->channel != NULL)
{
- empathy_tp_call_close (EMPATHY_TP_CALL (object));
+ g_signal_handlers_disconnect_by_func (priv->channel,
+ tp_call_channel_invalidated_cb, object);
+
+ g_object_unref (priv->channel);
+ priv->channel = NULL;
}
if (priv->stream_engine != NULL)
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index 6f55c6ba5..57e3277eb 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -896,7 +896,12 @@ tp_chat_dispose (GObject *object)
priv->dispose_has_run = TRUE;
if (priv->channel != NULL)
- empathy_tp_chat_close (self);
+ {
+ g_signal_handlers_disconnect_by_func (priv->channel,
+ tp_chat_invalidated_cb, self);
+ g_object_unref (priv->channel);
+ priv->channel = NULL;
+ }
if (priv->remote_contact != NULL)
g_object_unref (priv->remote_contact);
diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c
index 25f93713c..ccbc856a1 100644
--- a/libempathy/empathy-tp-file.c
+++ b/libempathy/empathy-tp-file.c
@@ -352,12 +352,10 @@ tp_file_finalize (GObject *object)
if (tp_file->priv->channel)
{
- DEBUG ("Closing channel..");
g_signal_handlers_disconnect_by_func (tp_file->priv->channel,
tp_file_invalidated_cb, object);
- tp_cli_channel_call_close (tp_file->priv->channel, -1, NULL, NULL,
- NULL, NULL);
g_object_unref (tp_file->priv->channel);
+ tp_file->priv->channel = NULL;
}
if (tp_file->priv->factory)
@@ -913,6 +911,7 @@ empathy_tp_file_cancel (EmpathyTpFile *tp_file)
{
g_return_if_fail (EMPATHY_IS_TP_FILE (tp_file));
+ DEBUG ("Closing channel..");
tp_cli_channel_call_close (tp_file->priv->channel, -1,
NULL, NULL, NULL, NULL);