aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/context2d/qquickcanvasitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items/context2d/qquickcanvasitem.cpp')
-rw-r--r--src/quick/items/context2d/qquickcanvasitem.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp
index 3b4adc15ca..e2f57fe162 100644
--- a/src/quick/items/context2d/qquickcanvasitem.cpp
+++ b/src/quick/items/context2d/qquickcanvasitem.cpp
@@ -564,9 +564,16 @@ QSGNode *QQuickCanvasItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData
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)