summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Koenig <tobias.koenig@kdab.com>2015-08-11 17:55:00 +0200
committerTobias Koenig <tobias.koenig@kdab.com>2015-08-11 16:02:06 +0000
commit5762738fce7306120c1d93da84ef9c2693d95881 (patch)
tree22f18d88515ac0dcefcd3592709680e94281b198
parent42054d0b6c3b906ba7b3815974c9d7738b49a9ea (diff)
Fix crash in QQuickCanvasItem::updatePaintNode()
QQuickCanvasItem manages the life time of the texture already, so it shouldn't set the ownsTexture flag on the QSGSimpleTextureNode, because that would result in a double deletion when QSGSimpleTextureNode::setTexture() is called. Change-Id: I7c1cc949b664d1a8b64bab092250439171e66233 Task-number: QTBUG-47714 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
-rw-r--r--src/quick/items/context2d/qquickcanvasitem.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp
index cb694c499a..75507c68d2 100644
--- a/src/quick/items/context2d/qquickcanvasitem.cpp
+++ b/src/quick/items/context2d/qquickcanvasitem.cpp
@@ -57,7 +57,11 @@ class QQuickCanvasNode : public QSGSimpleTextureNode
public:
QQuickCanvasNode() {
qsgnode_set_description(this, QStringLiteral("canvasnode"));
- setOwnsTexture(true);
+ setOwnsTexture(false);
+ }
+
+ ~QQuickCanvasNode() {
+ delete texture();
}
};