fix: Evaluator not exiting evaluating state correctly on error

This commit is contained in:
WerWolv 2022-10-09 17:31:06 +02:00
parent a44de63e24
commit 9055105627
2 changed files with 9 additions and 7 deletions

@ -1 +1 @@
Subproject commit 6880b7bb8e871f47ef4536dd59f35175aa2da4eb
Subproject commit b962a3db79b6f18c454a758cc72dd128ce1a4e28

View File

@ -854,16 +854,18 @@ namespace hex::plugin::builtin {
return this->m_dangerousFunctionsAllowed == DangerousFunctionPerms::Allow;
});
ON_SCOPE_EXIT {
this->m_lastEvaluationLog = runtime->getConsoleLog();
this->m_lastEvaluationOutVars = runtime->getOutVariables();
this->m_runningEvaluators--;
this->m_lastEvaluationProcessed = false;
};
this->m_lastEvaluationResult = runtime->executeString(code, envVars, inVariables);
if (!this->m_lastEvaluationResult) {
this->m_lastEvaluationError = runtime->getError();
}
this->m_lastEvaluationLog = runtime->getConsoleLog();
this->m_lastEvaluationOutVars = runtime->getOutVariables();
this->m_runningEvaluators--;
this->m_lastEvaluationProcessed = false;
});
}