lua-users home
lua-l archive

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


2009/12/11 cynthia powers <powcyn@gmail.com>:
> lua newbie question:

Lua newbie tip: always try to provide a complete example source code
(both Lua part and C part), so that we can reproduce the problem and
tell you what's wrong with it.

> I have a lua-calling c setup.
> I have a c function called in a while loop from lua. This function accesses
> a global array and is supposed to return the next member of the array in
> each call. The first call to the function from the lua side works ok, I
> notice that in the subsequent calls, it points to incorret locations. Has
> anyone seen something similar before? Any suggestions to fix this? The same
> function in a c-calling c setup works ok.

This may have several causes. Can you provide the source of the
incriminated lua_CFunction ?