From 9c515a6de24bc8d5709136cc099ceeae8e3e642c Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 25 Jul 2017 13:14:21 +0200 Subject: Do not (dis)connectNotify on dynamically created model item objects These item objects are direct subclasses of QObject, and cannot override connectNotify/disconnectNotify. This prevents the creation of the backing QMetaObject during disconnect, which happens during destruction, which in turn will call back into the model that is being destroyed. Task-number: QTBUG-59704 Change-Id: I7f997e5d2fda242b38e67b9147224d72aa4508ba Reviewed-by: Simon Hausmann --- src/qml/qml/qqmljavascriptexpression.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qml/qml/qqmljavascriptexpression.cpp') diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index 9d4e46e254..eec5d1ae57 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -283,7 +283,7 @@ void QQmlPropertyCapture::captureProperty(QQmlNotifier *n, Duration duration) \a n is in the signal index range (see QObjectPrivate::signalIndex()). */ -void QQmlPropertyCapture::captureProperty(QObject *o, int c, int n, Duration duration) +void QQmlPropertyCapture::captureProperty(QObject *o, int c, int n, Duration duration, bool doNotify) { if (watcher->wasDeleted()) return; @@ -319,7 +319,7 @@ void QQmlPropertyCapture::captureProperty(QObject *o, int c, int n, Duration dur Q_ASSERT(g->isConnected(o, n)); } else { g = QQmlJavaScriptExpressionGuard::New(expression, engine); - g->connect(o, n, engine); + g->connect(o, n, engine, doNotify); } if (duration == Permanently) -- cgit v1.2.3