lua-users home
lua-l archive

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


Unfortunately the default build with visual studio 9 does not support c++ functions.

I wrote a small test function:

class CppTest {
	public:
		CppTest(){printf("createdn");}
		~CppTest(){printf("destroyedn");}
};

int CppTestFunc(lua_State *L){
	CppTest test;
	luaL_error(L,"test_error");
	return 0;
}

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?

Regards Ingrater