qml: Fix leak of the OpenGL contexts

[Matthew Waters]: add NULL checks before unreffing

https://bugzilla.gnome.org/show_bug.cgi?id=762999
This commit is contained in:
Sergey Borovkov 2016-03-01 18:22:37 +03:00 committed by Matthew Waters
parent 6c6a9cf509
commit c2f17d4834

View file

@ -172,7 +172,10 @@ QtGLVideoItem::QtGLVideoItem()
QtGLVideoItem::~QtGLVideoItem()
{
g_mutex_clear (&this->priv->lock);
if (this->priv->context)
gst_object_unref(this->priv->context);
if (this->priv->other_context)
gst_object_unref(this->priv->other_context);
g_free (this->priv);
this->priv = NULL;
}