Clean up AngelScript context on exception.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
48ef465c82
commit
1046eceacf
@ -53,8 +53,18 @@ public:
|
||||
std::stringstream err; \
|
||||
err << "Script exception in script '" << GetName().c_str() << "', line " << ctx->GetExceptionLineNumber() \
|
||||
<< ". Message: '" << ctx->GetExceptionString() << "'."; \
|
||||
if (newContext) { \
|
||||
_ctxPool->ReturnContextToPool(ctx); \
|
||||
} else { \
|
||||
ctx->PopState(); \
|
||||
} \
|
||||
throw CreatureException(err.str()); \
|
||||
} \
|
||||
if (newContext) { \
|
||||
_ctxPool->ReturnContextToPool(ctx); \
|
||||
} else { \
|
||||
ctx->PopState(); \
|
||||
} \
|
||||
throw CreatureException("Script didn't finish properly; message " + std::to_string(scriptResult)); \
|
||||
} \
|
||||
if (newContext) { \
|
||||
|
Loading…
x
Reference in New Issue
Block a user