[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: customizable Lua "panic" behavior
- From: "Jim Mathies" <jamesmathies@...>
- Date: Mon, 19 Nov 2001 23:03:27 -0600
Do you remove the exit call with this? or are you saying it will never
be called? I can understand trapping exceptions, but if an exception
occurs, your Lua mem really may be totally hosed. Calling lua_close()
would have unpredictable results. Maybe i'm not following you here...
| This is the only solution I've actually liked thus far. It is easy to
| envision something like:
| void RunMain()
| // All app code that would've been in main() goes here.
| static int StartExecution(lua_State *L)
| return 0;
| int main()
| lua_pushcfunction(L, StartExecution);
| In a way, this is like a C++ exception handler (also illustrated above).
| The lua_call() acts just like a C++ try-catch block, except for Lua
| Because of this thread popping up over and over, a FAQ should be added
| to the Lua documentation...