aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextedit.cpp
diff options
context:
space:
mode:
authorAndrei Golubev <andrei.golubev@qt.io>2022-06-13 12:47:34 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2022-06-17 19:12:47 +0000
commitb616028dae933e7ff6142d41bdafee8ad445a8ec (patch)
tree05207fe222adb09a57e1317fe3ca215582b514d5 /src/quick/items/qquicktextedit.cpp
parent7424756626d2e4e3eefece4aba7ec514b1c5e052 (diff)
Do not leak in QQuickTextEdit::updatePaintNode()
Ensure all nodes created via d->createTextNode() within updatePaintNode have a parent. Some of the nodes missed parents due to overwrite of the local variable happening before addCurrentTextNodeToRoot() is called Task-number: QTBUG-103819 Pick-to: 6.3 6.4 Change-Id: I7261f6ad66c12e99601761073a2b0e931ff475ce Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquicktextedit.cpp')
-rw-r--r--src/quick/items/qquicktextedit.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index af99ebba19..fa4fb71be1 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -2238,6 +2238,8 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
if (inView) {
if (!engine.hasContents()) {
+ if (node && !node->parent())
+ d->addCurrentTextNodeToRoot(&engine, rootNode, node, nodeIterator, nodeStart);
node = d->createTextNode();
updateNodeTransform(node, nodeOffset);
nodeStart = block.position();