Simplify. RageException::Throw no longer actually throws; this makes

debugging much easier, since we don't lose the stack after a Lua error.
This commit is contained in:
Glenn Maynard
2005-01-28 19:42:44 +00:00
parent 3d0a566093
commit 703833d7d4
+3 -13
View File
@@ -106,20 +106,12 @@ void LuaManager::SetGlobal( const CString &sName )
} }
static jmp_buf jbuf;
static CString jbuf_error;
static int LuaPanic( lua_State *L ) static int LuaPanic( lua_State *L )
{ {
CString err; CString sErr;
LUA->PopStack( err ); LUA->PopStack( sErr );
/* Grr. We can't throw an exception from here: it'll explode going through the RageException::Throw( "%s", sErr.c_str() );
* Lua stack for some reason. Get it off the stack with a longjmp and throw
* an exception from there. */
jbuf_error = err;
longjmp( jbuf, 1 );
} }
@@ -143,8 +135,6 @@ LuaManager::LuaManager()
{ {
LUA = this; // so that LUA is available when we call the Register functions LUA = this; // so that LUA is available when we call the Register functions
if( setjmp(jbuf) )
RageException::Throw("%s", jbuf_error.c_str());
L = NULL; L = NULL;
ResetState(); ResetState();