Merge pull request #16115 from sabrina-shanman/crash_shutdown_running-script

Attempt to fix crash from script running too late
This commit is contained in:
Shannon Romano 2019-08-28 15:54:10 -07:00 committed by GitHub
commit f63fc15d4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -422,6 +422,12 @@ void ScriptEngine::waitTillDoneRunning() {
if (isEvaluating()) {
qCWarning(scriptengine) << "Script Engine has been running too long, aborting:" << getFilename();
abortEvaluation();
} else {
auto context = currentContext();
if (context) {
qCWarning(scriptengine) << "Script Engine has been running too long, throwing:" << getFilename();
context->throwError("Timed out during shutdown");
}
}
// Wait for the scripting thread to stop running, as
@ -444,9 +450,9 @@ void ScriptEngine::waitTillDoneRunning() {
qCWarning(scriptengine) << "Script Engine has been running too long, aborting:" << getFilename();
abortEvaluation();
} else {
qCWarning(scriptengine) << "Script Engine has been running too long, throwing:" << getFilename();
auto context = currentContext();
if (context) {
qCWarning(scriptengine) << "Script Engine has been running too long, throwing:" << getFilename();
context->throwError("Timed out during shutdown");
}
}