fix stack imbalance on error; RunExpression does this

This commit is contained in:
Glenn Maynard
2006-10-11 04:52:22 +00:00
parent f18cb36048
commit 33a4b55076
+2 -12
View File
@@ -585,12 +585,7 @@ namespace
if( EndsWith(sName, "Command") && sExpression.size() > 0 && sExpression[0] == '%' )
{
sExpression.erase( 0, 1 );
if( !LuaHelpers::RunExpression(L, sExpression, sFile) )
{
/* Compiling or running failed. An error was already logged; just push a dummy
* return value. */
lua_pushnil( L );
}
LuaHelpers::RunExpression( L, sExpression, sFile );
}
else if( EndsWith(sName, "Command") && (sExpression.size() == 0 || sExpression[0] != '%') )
{
@@ -604,12 +599,7 @@ namespace
}
else
{
if( !LuaHelpers::RunExpression(L, sExpression, sFile) )
{
/* Compiling or running failed. An error was already logged; just push a dummy
* return value. */
lua_pushnil( L );
}
LuaHelpers::RunExpression( L, sExpression, sFile );
}
delete pValue;