Merge pull request #1064 from ctrlaltdavid/fix/osx-exit-crash

Fix OSX crash on shutdown
This commit is contained in:
David Rowe 2021-03-02 17:08:26 +13:00 committed by GitHub
commit 46bf065ef7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -2989,6 +2989,8 @@ Application::~Application() {
qInstallMessageHandler(LogHandler::verboseMessageHandler);
#ifdef Q_OS_MAC
// 26 Feb 2021 - Tried re-enabling this call but OSX still crashes on exit.
//
// 10/16/2019 - Disabling this call. This causes known crashes (A), and it is not
// fully understood whether it might cause other unknown crashes (B).
//

View file

@ -470,7 +470,10 @@ void ScriptEngine::waitTillDoneRunning(bool shutdown) {
// We should never be waiting (blocking) on our own thread
assert(workerThread != QThread::currentThread());
#ifdef Q_OS_MAC
#if 0
// 26 Feb 2021 - Disabled this OSX-specific code because it causes OSX to crash on shutdown; without this code, OSX
// doesn't crash on shutdown. Qt 5.12.3 and Qt 5.15.2.
//
// On mac, don't call QCoreApplication::processEvents() here. This is to prevent
// [NSApplication terminate:] from prematurely destroying the static destructors
// while we are waiting for the scripts to shutdown. We will pump the message