summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Borovkov <sergey.borovkov@wireload.net>2016-03-01 18:22:37 +0300
committerMatthew Waters <matthew@centricular.com>2016-03-03 13:13:26 +1100
commit7981c1cb8608049ac7e78a6c3cb00b62dd7289e0 (patch)
tree5994d7b0c3c7c94b65115f4c16318f9b8269aba0
parentb077cd55108fc1c91f4c464124fb27dcb63b2bf2 (diff)
qml: Fix leak of the OpenGL contexts
[Matthew Waters]: add NULL checks before unreffing https://bugzilla.gnome.org/show_bug.cgi?id=762999
-rw-r--r--ext/qt/qtitem.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/qt/qtitem.cc b/ext/qt/qtitem.cc
index 57b7bc973..e1f91e76f 100644
--- a/ext/qt/qtitem.cc
+++ b/ext/qt/qtitem.cc
@@ -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;
}