lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Wow! Mike I am truly impressed.
One question.

> Document that compiling the Lua core with C++ exceptions makes throwing errors dead 
>slow. In fact there is no need to compile the core with C++ at all.
No matter how you compile
> it, it provides a C API only. And you ought to catch all C++ exceptions in your own module 
>code, anyway. At least now you get a proper error message if you
forget to do so.

I am (sadly) a VC6 user.

int somefunc(lua_State* L) 
  AClass anobject();
  luaL_error(L,"an error");

The problem here is that anobject() does not have its destructor called.
Compiling VC6 with /GX /EHsc- (Which tells C++ functions that C functions
MAY throw an exception) helps. I ended up using C++ exceptions because
it appears that setjmp/longjmp and try/catch/throw and C++ destructors are
an incompatible mix.

Do you have any wisdom on this subject? Does anyone else?