lua-users home
lua-l archive

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


> The other problem that happened to me was that Lua does not ensure the
> order of finalization. [...]

Lua does ensure the order of finalization:

  http://www.lua.org/manual/5.1/manual.html#2.10.1

  At the end of each garbage-collection cycle, the finalizers for userdata
  are called in reverse order of their creation, among those collected
  in that cycle.


  http://www.lua.org/manual/5.2/manual.html#2.5.1

  At the end of each garbage-collection cycle, the finalizers for objects
  are called in the reverse order that they were marked for collection,
  among those collected in that cycle

(Of course, that order may not be the one you want.)

-- Roberto