summaryrefslogtreecommitdiff
path: root/telepathy-farstream
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2012-03-07 15:58:58 -0500
committerOlivier CrĂȘte <olivier.crete@collabora.com>2012-03-07 15:58:58 -0500
commit7b19cb3730ce59322a7f41b5a99044163bb35818 (patch)
treee99a52aad72cc24d095ecb7e9cd1e86481b0547d /telepathy-farstream
parent5c1ea995af69e251bce731c22b47fbcea158da55 (diff)
downloadtelepathy-farstream-7b19cb3730ce59322a7f41b5a99044163bb35818.tar.gz
CallContent: Guard against early dispose in some callbacks
Diffstat (limited to 'telepathy-farstream')
-rw-r--r--telepathy-farstream/call-content.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/telepathy-farstream/call-content.c b/telepathy-farstream/call-content.c
index efe6c15..349fc6e 100644
--- a/telepathy-farstream/call-content.c
+++ b/telepathy-farstream/call-content.c
@@ -1088,13 +1088,7 @@ got_content_media_properties (TpProxy *proxy, GHashTable *properties,
/* Guard against early disposal */
if (self->call_channel == NULL)
- {
- g_simple_async_result_set_error (res, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
- "Call content has been disposed of");
- g_simple_async_result_complete (res);
- g_object_unref (res);
- return;
- }
+ goto disposed;
if (error != NULL)
{
@@ -1170,6 +1164,9 @@ got_content_media_properties (TpProxy *proxy, GHashTable *properties,
fs_element_added_notifier_add (self->notifier,
GST_BIN (self->fsconference));
+ /* Guard against early disposal */
+ if (self->call_channel == NULL)
+ goto disposed;
gva = tp_asv_get_boxed (properties, "MediaDescriptionOffer",
TP_STRUCT_TYPE_MEDIA_DESCRIPTION_OFFER);
@@ -1197,6 +1194,10 @@ got_content_media_properties (TpProxy *proxy, GHashTable *properties,
g_simple_async_result_set_op_res_gboolean (res, TRUE);
g_simple_async_result_complete (res);
+ /* Guard against early disposal */
+ if (self->call_channel == NULL)
+ goto disposed_already_completed;
+
/* Now process outstanding streams */
add_initial_streams (self);
@@ -1243,6 +1244,17 @@ got_content_media_properties (TpProxy *proxy, GHashTable *properties,
g_simple_async_result_complete (res);
g_object_unref (res);
return;
+
+ disposed:
+
+ g_simple_async_result_set_error (res, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
+ "Call content has been disposed of");
+ g_simple_async_result_complete (res);
+
+ /* fallthrough */
+ disposed_already_completed:
+ g_object_unref (res);
+ return;
}
static void