dtlsconnection: Fix memory leak while setting closure

https://bugzilla.gnome.org/show_bug.cgi?id=749325
This commit is contained in:
Jose Antonio Santos Cadenas 2015-05-13 17:19:25 +02:00 committed by Sebastian Dröge
parent 1f738ca5b8
commit c44acd8bde

View file

@ -454,6 +454,10 @@ gst_dtls_connection_set_send_callback (GstDtlsConnection * self,
g_mutex_lock (&self->priv->mutex); g_mutex_lock (&self->priv->mutex);
GST_TRACE_OBJECT (self, "locked @ set_send_callback"); GST_TRACE_OBJECT (self, "locked @ set_send_callback");
if (self->priv->send_closure) {
g_closure_unref (self->priv->send_closure);
self->priv->send_closure = NULL;
}
self->priv->send_closure = closure; self->priv->send_closure = closure;
if (closure && G_CLOSURE_NEEDS_MARSHAL (closure)) { if (closure && G_CLOSURE_NEEDS_MARSHAL (closure)) {