diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2012-02-13 17:45:38 -0500 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2012-02-13 17:45:38 -0500 |
commit | 997315eefccb118235c1658983e14070d8865acf (patch) | |
tree | f66b8389464738856c23a2fa515f7acec0f6adac /rakia/sip-session.c | |
parent | 469c35c7a6f3af4174f6ba4054562d1bdc4f0769 (diff) |
The Media GPtrArray can contain NULLs, so allow them
Diffstat (limited to 'rakia/sip-session.c')
-rw-r--r-- | rakia/sip-session.c | 9 |
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, |