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 b077cd5510
commit 7981c1cb86

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;
}