lua-users home
lua-l archive

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


webmaster@benjamin-thaut.de wrote:
> Unfortunately the default build with visual studio 9 does not
> support c++ functions.

This needs the code from the git repository. The beta2 release
doesn't include this functionality.

And as doc/api.html and src/lj_err.c indicates it only works for
Windows x64, POSIX/x64 and (with some effort) for POSIX/x86. It
does not and will not work with Windows x86 due to the SEH
software patent.

> with the default lua library build as c++ code the console
> correctly states "created, destroyed". When I call this function
> with lua jit the console only states "created" meaning the
> destructor is never called. As I'm using a lot of RAII objects
> in my lua bindings this would be essential for having no memory
> leaks. How can I achive that lua jit is build as c++ library and
> therefore does correclty handle the lua error functions?

This code works fine here with an out-of-the-box build of LuaJIT
on Windows/x64. Currently you need to compile your own C++ code
with /EHa. Apparently MSVC doesn't call C++ destructors for
foreign exceptions unless you use this flag. This is unfortunate,
but there's no easy workaround.

--Mike