summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-03-12 15:14:48 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2013-03-12 15:14:48 +0100
commit9ea571eca7d12648776c7179255711dbdd9aac25 (patch)
tree5dc11a97fc03f399bf2788561035197876f0522f /tests
parent348e79afabca8a1f292ccf69e932d48553103a80 (diff)
downloadtelepathy-glib-9ea571eca7d12648776c7179255711dbdd9aac25.tar.gz
file-transfer-chan: don't call start_file_transfer() after disposal
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/file-transfer-chan.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/lib/file-transfer-chan.c b/tests/lib/file-transfer-chan.c
index 36c10ddfd..97a370f28 100644
--- a/tests/lib/file-transfer-chan.c
+++ b/tests/lib/file-transfer-chan.c
@@ -81,6 +81,8 @@ struct _TpTestsFileTransferChannelPrivate {
gchar *unix_address;
guint connection_id;
TpSocketAccessControl access_control;
+
+ guint timer_id;
};
static void
@@ -135,6 +137,12 @@ dispose (GObject *object)
{
TpTestsFileTransferChannel *self = TP_TESTS_FILE_TRANSFER_CHANNEL (object);
+ if (self->priv->timer_id != 0)
+ {
+ g_source_remove (self->priv->timer_id);
+ self->priv->timer_id = 0;
+ }
+
g_free (self->priv->content_hash);
g_free (self->priv->content_type);
g_free (self->priv->description);
@@ -485,7 +493,7 @@ file_transfer_provide_file (TpSvcChannelTypeFileTransfer *iface,
self->priv->access_control = access_control;
DEBUG ("Waiting 500ms and setting state to OPEN");
- g_timeout_add (500, start_file_transfer, self);
+ self->priv->timer_id = g_timeout_add (500, start_file_transfer, self);
// connect to self->priv->service incoming signal
// when the signal returns, add x bytes per n seconds using timeout
@@ -552,7 +560,7 @@ file_transfer_accept_file (TpSvcChannelTypeFileTransfer *iface,
TP_FILE_TRANSFER_STATE_CHANGE_REASON_REQUESTED);
DEBUG ("Waiting 500ms and setting state to OPEN");
- g_timeout_add (500, start_file_transfer, self);
+ self->priv->timer_id = g_timeout_add (500, start_file_transfer, self);
tp_svc_channel_type_file_transfer_return_from_accept_file (context,
address);