From 1dc889c6d0d84825924a7ec925275a07c966812b Mon Sep 17 00:00:00 2001 From: Roman Nowicki Date: Fri, 20 Nov 2015 11:18:43 +1100 Subject: [PATCH] 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/qt/qtitem.cc b/ext/qt/qtitem.cc index ec2e859d24..ca8e535fe3 100644 --- a/ext/qt/qtitem.cc +++ b/ext/qt/qtitem.cc @@ -205,12 +205,12 @@ QtGLVideoItem::updatePaintNode(QSGNode * oldNode, if (!texNode) { texNode = new QSGSimpleTextureNode (); texNode->setOwnsTexture (true); + 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;