summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Vehmanen <kai.vehmanen@nokia.com>2011-01-20 23:41:38 +0200
committerKai Vehmanen <kai.vehmanen@nokia.com>2011-01-21 13:15:55 +0200
commit5c90b6cfa64c88a08d1bb3e5b5073279a8cf15bf (patch)
tree88b0d0cd70f57b4dbbbb476bfcc724414fb6d951
parent3bcc59b7b20b694e5bcd719816f1f6d328ddb8db (diff)
ring-conference-channel: keep a self ref while removing channels
ring_conference_channel_emit_channel_removed() can lead to tearing down the whole conference if no participants are left. To properly do channel clean up, and send a signal for conference channel close, keep a self reference until the function is completed.
-rw-r--r--src/ring-conference-channel.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ring-conference-channel.c b/src/ring-conference-channel.c
index f4789db..8636f13 100644
--- a/src/ring-conference-channel.c
+++ b/src/ring-conference-channel.c
@@ -1438,6 +1438,10 @@ ring_conference_channel_emit_channel_removed(
if (i >= MODEM_MAX_CALLS)
return;
+ /* note: as this function may lead to tearing down the whole
+ * conference, keep a local self-reference */
+ g_object_ref (self);
+
while (member) {
TpIntSet *remove = tp_intset_new();
@@ -1495,7 +1499,7 @@ ring_conference_channel_emit_channel_removed(
}
if (n > 2)
- return;
+ goto out;
DEBUG("Too few members, close channel %p", self);
@@ -1504,6 +1508,9 @@ ring_conference_channel_emit_channel_removed(
* not hangup.
*/
ring_conference_channel_close_impl (self, FALSE, FALSE);
+
+out:
+ g_object_unref (self);
}