summaryrefslogtreecommitdiff
path: root/indra/llcommon/lua_function.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/lua_function.h')
-rw-r--r--indra/llcommon/lua_function.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/indra/llcommon/lua_function.h b/indra/llcommon/lua_function.h
index 12e74b5d04..10c201c234 100644
--- a/indra/llcommon/lua_function.h
+++ b/indra/llcommon/lua_function.h
@@ -172,7 +172,10 @@ public:
LuaRemover& operator=(const LuaRemover&) = delete;
~LuaRemover()
{
- lua_remove(mState, mIndex);
+ // If we're unwinding the C++ stack due to an exception, don't mess
+ // with the Lua stack!
+ if (std::uncaught_exceptions() == 0)
+ lua_remove(mState, mIndex);
}
private: