aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Curtis <[email protected]>2025-05-30 15:29:43 +0800
committerMitch Curtis <[email protected]>2025-06-02 16:52:40 +0800
commit87d82d734bb9b02949eeaa722b134283b6424e31 (patch)
treec0c5ceef1f92afa2cc20992ca90f7ffdcfadd992
parenta96b4cdb1958df7786969f5185474b1dc8795f07 (diff)
QQuickItem: don't try to print id when item is being destroyedHEADdev
This can be reproduced by adding this to the top of ~QQuickItem qDebug() << "destroying" << this << d; and then running "tst_qquicklistview2 delegateContextHandling". Amends 3d3de0f5a47a249a0229edcca18cf71826bd4bc0. Pick-to: 6.8 6.9 Change-Id: I801e770c173acc5a55cfca4230a60d063b762d65 Reviewed-by: Fabian Kosmale <[email protected]>
-rw-r--r--src/quick/items/qquickitem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 436db685e0..629c387d4f 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -9247,7 +9247,7 @@ QDebug operator<<(QDebug debug,
// Deferred properties will cause recursion when calling nameForObject
// before the component is completed, so guard against this situation.
- if (item->isComponentComplete()) {
+ if (item->isComponentComplete() && !QQmlData::wasDeleted(item)) {
if (QQmlContext *context = qmlContext(item)) {
const auto objectId = context->nameForObject(item);
if (!objectId.isEmpty())