summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2011-11-10 12:06:39 +0000
committerJonny Lamb <jonny.lamb@collabora.co.uk>2011-11-11 10:50:53 +0000
commitf6a02a0c92074d3b879e1f709264ef42fed5f178 (patch)
tree46cf403f29d10a92b567ab449297e5f0a793e339
parent3092ef449b20759fce14e9689664f366755beada (diff)
ft-channel: don't potentially call _cancel on a NULL GCancellable
> I don't think this is safe. TpProxy's _dispose() method, which is > called after TpFileTransferChannel's, emits invalidated if the proxy > wasn't already invalidated. But by that time, > self->priv->cancellable will have been freed by TpFTChannel's > _dispose() implementation. Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r--telepathy-glib/file-transfer-channel.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/telepathy-glib/file-transfer-channel.c b/telepathy-glib/file-transfer-channel.c
index 8e2c8b3a3..6ad9552f9 100644
--- a/telepathy-glib/file-transfer-channel.c
+++ b/telepathy-glib/file-transfer-channel.c
@@ -423,7 +423,8 @@ invalidated_cb (TpFileTransferChannel *self,
gpointer user_data)
{
/* stop splicing */
- g_cancellable_cancel (self->priv->cancellable);
+ if (self->priv->cancellable != NULL)
+ g_cancellable_cancel (self->priv->cancellable);
}
/* Private methods */
@@ -691,6 +692,9 @@ tp_file_transfer_channel_dispose (GObject *obj)
tp_clear_pointer (&self->priv->date, g_date_time_unref);
g_clear_object (&self->priv->file);
+
+ if (self->priv->cancellable != NULL)
+ g_cancellable_cancel (self->priv->cancellable);
g_clear_object (&self->priv->cancellable);
if (self->priv->remote_address != NULL)