lua-users home
lua-l archive

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

> How do you pass your userdata object into Lua calls?  That is, say I 
> have C++ code that wants to call a function like:
> int doSomething(MyObject* obj);

Now you caught  me... What you would like  to have is strong  ref to the
C++ object stored in it. But  that would kill garbage collection because
of the cycle. I agree that here  a weak ref would be greatly appreciated

Using lua_pushuserdatabox too much might become a problem. I will try to
find an elegant solution and post it if I find it.