Fix memory leak of animated image textures

This commit is contained in:
Nicolas Werner 2021-08-29 18:38:11 +02:00
parent 374ad0a816
commit 7645ab1736
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -152,8 +152,10 @@ MxcAnimatedImage::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeD
imageDirty = false; imageDirty = false;
QSGImageNode *n = static_cast<QSGImageNode *>(oldNode); QSGImageNode *n = static_cast<QSGImageNode *>(oldNode);
if (!n) if (!n) {
n = window()->createImageNode(); n = window()->createImageNode();
n->setOwnsTexture(true);
}
// n->setTexture(nullptr); // n->setTexture(nullptr);
auto img = movie.currentImage(); auto img = movie.currentImage();