mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 04:57:23 +02:00
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:
commit
f63fc15d4f
1 changed files with 7 additions and 1 deletions
|
@ -422,6 +422,12 @@ void ScriptEngine::waitTillDoneRunning() {
|
||||||
if (isEvaluating()) {
|
if (isEvaluating()) {
|
||||||
qCWarning(scriptengine) << "Script Engine has been running too long, aborting:" << getFilename();
|
qCWarning(scriptengine) << "Script Engine has been running too long, aborting:" << getFilename();
|
||||||
abortEvaluation();
|
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
|
// 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();
|
qCWarning(scriptengine) << "Script Engine has been running too long, aborting:" << getFilename();
|
||||||
abortEvaluation();
|
abortEvaluation();
|
||||||
} else {
|
} else {
|
||||||
qCWarning(scriptengine) << "Script Engine has been running too long, throwing:" << getFilename();
|
|
||||||
auto context = currentContext();
|
auto context = currentContext();
|
||||||
if (context) {
|
if (context) {
|
||||||
|
qCWarning(scriptengine) << "Script Engine has been running too long, throwing:" << getFilename();
|
||||||
context->throwError("Timed out during shutdown");
|
context->throwError("Timed out during shutdown");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue