[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Loadlib's callfromlib() - anybody using it?!?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 10 Jun 2002 10:58:51 -0300
>The only major need I found with 5.0 'lua.c' concerning this was the
>capability to have library cleanups
There a trick for this that could/should be implemented in lauxlib:
Each time you open a library that needs to clean itselt up, create a userdata,
store it in the registry (using itself as both key and value), and set up a GC
method for this userdata that does the cleanup. When lua_close is called, your
GC method will be called automatically.
--lhf