lua-users home
lua-l archive

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


>   do well with tolua: callbacks. I'd like to be able to pass 
>a reference
>   of a Lua function to a C++ method that calls the referred 
>function at
>   an arbitrary later time. Is there an easy way to do this? The only


Have you tried passing a (locked reference to a) lua_Object containing
the function address ?
Functions in Lua can be handled like any other type, as in C. The only
tricky part is that you must ensure your callback is not GC'd. So lock
it and get a reference to it before use (lua_ref(1).)


--vp

Windows is slow and crashaholic ? Linux is too hard to learn ? Try BeOS
!