From c3762420f708399b41628bf65f6ffd0d1f2d8a3a Mon Sep 17 00:00:00 2001 From: Roman Nowicki Date: Fri, 20 Nov 2015 11:18:43 +1100 Subject: qml: reuse existing GstQSGTexture Fixes a memory leak leaking the texture objects. https://bugzilla.gnome.org/show_bug.cgi?id=758286 --- ext/qt/qtitem.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ext/qt/qtitem.cc b/ext/qt/qtitem.cc index 63060e163..5786c4110 100644 --- a/ext/qt/qtitem.cc +++ b/ext/qt/qtitem.cc @@ -183,14 +183,12 @@ QtGLVideoItem::updatePaintNode(QSGNode * oldNode, if (!texNode) { texNode = new QSGSimpleTextureNode (); texNode->setOwnsTexture (true); - } else { - tex = static_cast (texNode->texture()); + texNode->setTexture (new GstQSGTexture ()); } - tex = new GstQSGTexture (); + tex = static_cast (texNode->texture()); tex->setCaps (this->priv->caps); tex->setBuffer (this->priv->buffer); - texNode->setTexture (tex); if (this->priv->force_aspect_ratio) { src.w = this->priv->display_width; -- cgit v1.2.1