lua-users home
lua-l archive

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


I have been using Lua 4.0 for some time, and it only just occurred to me
that, since I've modified it in various ways, it might make sense for me
to run it with LUA_DEBUG turned on. duh.

So, I did that, and I am tripping an assertion when I call lua_close().
the assert is this one, in luaS_freeall:

  luaM_free(L, L->strt.hash);
  LUA_ASSERT(L->udt.nuse==0, "non-empty udata table");
  luaM_free(L, L->udt.hash);

Now, AFAICT, all the userdata values are being properly collected by
collectudata() in luaC_collect. However, right after calling collectudata,
luaC_collect calls callgcTMudata - which seems to put more userdata values
into L->udt! I have not yet figured out what these additional values are
(I'm guessing they are cleanup stuff left around by toLua). Any
suggestions? I'm going to try putting another call to collectudata() at
the bottom of luaC_collect to see if that affects anything. Anything else
I should try?

Your suggestions are most welcome...

Eric