summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Crête <olivier.crete@collabora.com>2012-03-18 20:55:41 (GMT)
committerOlivier Crête <olivier.crete@collabora.com>2012-03-18 20:55:41 (GMT)
commitc4880f4fa3118b57ac007aab54ee5201c471136b (patch)
treedff682c62c7d2263a642e02a9f8d240f1bd76343
parentb707a6c14e96155c225af1ba1ed70ffe473c0ddd (diff)
downloadtelepathy-farstream-c4880f4fa3118b57ac007aab54ee5201c471136b.tar.gz
telepathy-farstream-c4880f4fa3118b57ac007aab54ee5201c471136b.tar.xz
Release resources when destroying TfCallStream
-rw-r--r--telepathy-farstream/call-stream.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/telepathy-farstream/call-stream.c b/telepathy-farstream/call-stream.c
index 6a21775..4d17f4f 100644
--- a/telepathy-farstream/call-stream.c
+++ b/telepathy-farstream/call-stream.c
@@ -97,7 +97,20 @@ _tf_call_stream_destroy (TfCallStream *self)
self->proxy = NULL;
if (self->fsstream)
- _tf_call_content_put_fsstream (self->call_content, self->fsstream);
+ {
+ g_object_set (self->fsstream, "direction", FS_DIRECTION_NONE, NULL);
+
+ if (self->has_send_resource)
+ _tf_content_stop_sending (TF_CONTENT (self->call_content));
+ self->has_send_resource = FALSE;
+
+ if (self->has_receive_resource)
+ _tf_content_stop_receiving (TF_CONTENT (self->call_content),
+ &self->contact_handle, 1);
+ self->has_receive_resource = FALSE;
+ _tf_call_content_put_fsstream (self->call_content, self->fsstream);
+ }
+
self->fsstream = NULL;
if (self->endpoint)