diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2010-03-26 18:47:49 +0000 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2010-03-26 18:47:49 +0000 |
commit | 06e4c10fd76c90ad41fadce1d0ef04b285578f1f (patch) | |
tree | 6dc3e2663ab291b6af6d37ca958a8c4f018e82d0 | |
parent | 7ee058820670fc379c0ae89d97f7cb71e5e59407 (diff) |
Fix refcounting of the JingleSession
When asking the jingle factory to create a session it gives you back a object
you don't have a ref to, so first of all make sure we have a ref. And second,
do actually unref it when disposing the channel :)
-rw-r--r-- | src/call-channel.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/call-channel.c b/src/call-channel.c index 9c43877e4..cbbf9a01b 100644 --- a/src/call-channel.c +++ b/src/call-channel.c @@ -618,6 +618,10 @@ gabble_call_channel_dispose (GObject *object) g_list_free (priv->contents); priv->contents = NULL; + if (priv->session != NULL) + g_object_unref (priv->session); + priv->session = NULL; + if (G_OBJECT_CLASS (gabble_call_channel_parent_class)->dispose) G_OBJECT_CLASS (gabble_call_channel_parent_class)->dispose (object); } @@ -1113,6 +1117,8 @@ call_channel_init_async (GAsyncInitable *initable, priv->session = gabble_jingle_factory_create_session ( priv->conn->jingle_factory, priv->target, resource, FALSE); + g_object_ref (priv->session); + gabble_signal_connect_weak (priv->session, "notify::state", G_CALLBACK (call_session_state_changed_cb), G_OBJECT (self)); gabble_signal_connect_weak (priv->session, "new-content", |