diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-04-13 11:21:25 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-04-13 08:33:47 -0700 |
commit | 3d4412ad1a346d80959cd78395703636d9127699 (patch) | |
tree | f57982f77cc77c1dbd826444740faeab0da701e4 /mobile-widgets | |
parent | 24eac8df872747f6283d21d36f09fe0cbb683210 (diff) | |
download | subsurface-3d4412ad1a346d80959cd78395703636d9127699.tar.gz |
mobile: don't call main loop for notifications once initialized
Calling qApp->processEvents() in QMLManager::setNotificationText()
caused crashes, because it could lead to the context-menu that
initialized the call being deleted. Something that QML apparently
doesn't like.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index a610b36cd..0e7e16ddb 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -1710,7 +1710,12 @@ void QMLManager::setNotificationText(QString text) appendTextToLog(QStringLiteral("showProgress: ") + text); m_notificationText = text; emit notificationTextChanged(); - qApp->processEvents(); + // Once we're initialized, this may be called from signal context, notably when selecting an action from a context menu. + // Processing events may now cause the menu to be deleted. Deleting a QML object which sent a signal causes QML to quit the application. + // Therefore, don't process events once the application is started. + // During startup this is needed so that the notifications are shown. + if (!m_initialized) + qApp->processEvents(); } qreal QMLManager::lastDevicePixelRatio() |