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