Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.9.3, 5.10.0
-
macOS 10.12 / Windows 10
-
243b819ff73f6aaa9dc068d43b8b918a98f53663
Description
There's a memory leak when setting texture to QSGFramebufferObjectNode object in QQuickFramebufferObject::updatePaintNode() function defined in qtdeclarative/src/quick/items/qquickframebufferobject.cpp
n->setTexture(window()->createTextureFromId(displayTexture, n->fbo->size(), QQuickWindow::TextureHasAlphaChannel));
If QSGFramebufferObjectNode object already owns the texture that one is not released, causing memory leak.
QSGFramebufferObjectNode is managing the lifetime of the texture manually without using parent class QSGSimpleTextureNode::setOwnsTexture() function, as suggested by this code in its destructor:
~QSGFramebufferObjectNode()
{
delete renderer;
delete texture(); // << HERE
delete fbo;
delete msDisplayFbo;
}
Is there a reason why it does not make use of setOwnsTexture()?