Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.2, 6.2.4
-
None
-
macOS Big Sur(11.6)
MacBook Pro(13-inch, M1, 2020)
Chip Apple M1
Memory 16GB
Description
Description: Qt application interrupts macOS from restarting or shut downing if any clean-up code in aboutToQuit signal emitted time take some time(from my side 200 ms is enough). OS always shows
Example:
QObject::connect(qApp, &QGuiApplication::aboutToQuit, qApp, [](){ // long time close opperation // write to file // save data in db // generation data and save on disk // and so on std::this_thread::sleep_for(std::chrono::milliseconds(10000)); });
Steps to reproduce:
1 Run attached application
2 Restart macOS
Expected result: It is possible to clean-up code in any way without any interruptions and additional warnings from OS side.
NOTE: - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
return NSTerminateNow or NSTerminateCancel
Suggestion: Consider returning NSTerminateLater and call
[NSApp replyToApplicationShouldTerminate:YES];
in ~QApplication for example
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-102321 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
433998,2 | GuiApplication: fix macOS restart/shutdown interrupt | dev | qt/qtbase | Status: NEW | -2 | 0 |