summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2017-04-20 12:05:11 +0200
committerMilian Wolff <milian.wolff@kdab.com>2017-05-15 14:37:49 +0000
commit446978af11ab886d734ca3972dcd73f847df9fbc (patch)
tree3d002cb799aa73aad0c93929b083903c66a48e7c /src
parent36a42a2ebd3198654a29afe7f6bb450849c745ea (diff)
downloadqtwebchannel-446978af11ab886d734ca3972dcd73f847df9fbc.tar.gz
Gracefully handle early deregistration of objects
When an object is deregistered before the signal handler got initializated, we asserted. Now, we check for this case and skip the signal handler removal when it wasn't set up yet. Change-Id: I7abad204cbab72be7729d42f58ce63babd2310d8 Task-number: QTBUG-60250 Reviewed-by: Kai Dohmen <psykai1993@googlemail.com> Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'src')
-rw-r--r--src/webchannel/qmetaobjectpublisher.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/webchannel/qmetaobjectpublisher.cpp b/src/webchannel/qmetaobjectpublisher.cpp
index 148404d..dcc589c 100644
--- a/src/webchannel/qmetaobjectpublisher.cpp
+++ b/src/webchannel/qmetaobjectpublisher.cpp
@@ -454,8 +454,12 @@ void QMetaObjectPublisher::objectDestroyed(const QObject *object)
Q_ASSERT(removed);
Q_UNUSED(removed);
- signalHandler.remove(object);
- signalToPropertyMap.remove(object);
+ // only remove from handler when we initialized the property updates
+ // cf: https://bugreports.qt.io/browse/QTBUG-60250
+ if (propertyUpdatesInitialized) {
+ signalHandler.remove(object);
+ signalToPropertyMap.remove(object);
+ }
pendingPropertyUpdates.remove(object);
}