summaryrefslogtreecommitdiff
path: root/rakia/sip-session.c
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2012-02-13 17:45:38 -0500
committerOlivier CrĂȘte <olivier.crete@collabora.com>2012-02-13 17:45:38 -0500
commit997315eefccb118235c1658983e14070d8865acf (patch)
treef66b8389464738856c23a2fa515f7acec0f6adac /rakia/sip-session.c
parent469c35c7a6f3af4174f6ba4054562d1bdc4f0769 (diff)
The Media GPtrArray can contain NULLs, so allow them
Diffstat (limited to 'rakia/sip-session.c')
-rw-r--r--rakia/sip-session.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/rakia/sip-session.c b/rakia/sip-session.c
index e12fa63..7e9ebe8 100644
--- a/rakia/sip-session.c
+++ b/rakia/sip-session.c
@@ -185,6 +185,13 @@ event_target_init(gpointer g_iface, gpointer iface_data)
}
static void
+null_safe_unref (gpointer data)
+{
+ if (data)
+ g_object_unref (data);
+}
+
+static void
rakia_sip_session_init (RakiaSipSession *self)
{
RakiaSipSessionPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
@@ -196,7 +203,7 @@ rakia_sip_session_init (RakiaSipSession *self)
priv->rtcp_enabled = TRUE;
/* allocate any data required by the object here */
- priv->medias = g_ptr_array_new_with_free_func (g_object_unref);
+ priv->medias = g_ptr_array_new_with_free_func (null_safe_unref);
}
static void rakia_sip_session_get_property (GObject *object,