In commit
be4c74948371ddf6f1ed260783b43b5a3d9e60a7 we removed the
QQuickCanvasItemNode, but textures are not automatically deleted with
QSGSimpleTextureNode, so add a very thin sub class of QSGSimpleTextureNode
to just cleanup canvas texture to avoid texture leaks.
Change-Id: I31aac1068e8218a75129b52afbbf30fb66e4bbf7
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
if (!d->contextInitialized)
return 0;
- QSGSimpleTextureNode *node = static_cast<QSGSimpleTextureNode*>(oldNode);
+ class CanvasTextureNode : public QSGSimpleTextureNode
+ {
+ public:
+ CanvasTextureNode() : QSGSimpleTextureNode() {}
+ ~CanvasTextureNode() {delete texture();}
+ };
+
+ CanvasTextureNode *node = static_cast<CanvasTextureNode*>(oldNode);
if (!node) {
- node = new QSGSimpleTextureNode;
+ node = new CanvasTextureNode;
}
if (d->renderStrategy == QQuickCanvasItem::Cooperative)