diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2024-01-17 09:01:20 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2024-01-17 20:30:47 +0100 |
| commit | 9d8e78a2f2661d8a1f2909bfe8a20e15f833af2e (patch) | |
| tree | 571b61e916ce6baf1ab92f3dceff942f62f15f20 /src/qml/jsruntime/qv4qobjectwrapper.cpp | |
| parent | 1a5f10746ab42527f9a0c7aa170b3f593b31bffb (diff) | |
QtQml: Do not call signal handlers on half-deleted objects
Pick-to: 6.7 6.6
Fixes: QTBUG-121022
Change-Id: Icdefd6bef4906700d88eca47c09d0abe54f1eec9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/qml/jsruntime/qv4qobjectwrapper.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index c4ae949ea8..5463133801 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -1197,13 +1197,15 @@ struct QObjectSlotDispatcher : public QtPrivate::QSlotObjectBase static void impl(int which, QSlotObjectBase *this_, QObject *receiver, void **metaArgs, bool *ret) { - Q_UNUSED(receiver); switch (which) { case Destroy: { delete static_cast<QObjectSlotDispatcher*>(this_); } break; case Call: { + if (QQmlData::wasDeleted(receiver)) + break; + QObjectSlotDispatcher *This = static_cast<QObjectSlotDispatcher*>(this_); ExecutionEngine *v4 = This->function.engine(); // Might be that we're still connected to a signal that's emitted long |
