2013/1/3 Mike Pall <mike-1301@xxxxxxxxxx>: > > Your problem sounds like an interaction with C++ RAII (automatic > destructors). Because this implicitly sets up SEH frames and those > get messed up when lua_error() unwinds the stack. You mean that exported C++ functions must not have automatic objects in them? Because that would be very unfortunate. C++ stack unwinding always calls destructors of automatic objects whether they have RAII semantics or not. > > So check your code for uses of RAII. AFAIR Luabind has (or had?) > some of these internally, too. In which conditions are destructors dangerous (I assume that is what you mean by RAII)? > > [Anyway, Luabind has a high binding overhead and most of the CPU > time is probably spent there. LuaJIT is not going to help you with > that.] We do see huge speedup when using LuaJIT during longer Lua AI processing. Lua UI code otoh often calls C++ functions for example to load texture resource which throws C++ exception if file is not found. What in luabind makes it of higher overhead? /Simon