qml: Fix leak of the OpenGL contexts
authorSergey Borovkov <sergey.borovkov@wireload.net>
Tue, 1 Mar 2016 15:22:37 +0000 (18:22 +0300)
committerMatthew Waters <matthew@centricular.com>
Thu, 3 Mar 2016 02:13:26 +0000 (13:13 +1100)
[Matthew Waters]: add NULL checks before unreffing

https://bugzilla.gnome.org/show_bug.cgi?id=762999

ext/qt/qtitem.cc

index 57b7bc9..e1f91e7 100644 (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;
 }