mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Fix another leak when creating an animated image without an image
This commit is contained in:
parent
b5b580fda5
commit
fc7df50d9a
1 changed files with 6 additions and 1 deletions
|
@ -155,14 +155,19 @@ MxcAnimatedImage::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeD
|
|||
if (!n) {
|
||||
n = window()->createImageNode();
|
||||
n->setOwnsTexture(true);
|
||||
// n->setFlags(QSGNode::OwnedByParent | QSGNode::OwnsGeometry |
|
||||
// GSGNode::OwnsMaterial);
|
||||
n->setFlags(QSGNode::OwnedByParent);
|
||||
}
|
||||
|
||||
// n->setTexture(nullptr);
|
||||
auto img = movie.currentImage();
|
||||
if (!img.isNull())
|
||||
n->setTexture(window()->createTextureFromImage(img));
|
||||
else
|
||||
else {
|
||||
delete n;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
n->setSourceRect(img.rect());
|
||||
n->setRect(QRect(0, 0, width(), height()));
|
||||
|
|
Loading…
Reference in a new issue