lua-users home
lua-l archive

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


It would be nice to put the handles in a special table, something like:
__lib, so that libraries could be unloaded manually or when the app closes.
The same thing applies with dlfcn, but using dlclose instead of FreeLibrary.
Leaving libraries open doesn't seem to be a good programming practice. 

--
Ignacio Castaño
castanyo@yahoo.es


--- David Burgess <dburgess@gmail.com> escribió: 
> Would it be possible to add a GC method to the Win32 code
> in loadlib.c for library handles?
> 
> e,g,
> 
> static int loadlib_gc(lua_State *L)
> {
>     HMODULE h = (HMODULE)(lua_unboxpointer(L,1));
>     if (h)  FreeLibrary(h);
>     return 0;
> }
> 
> In practice this method only gets called when lua_close() is called.
> 



		
______________________________________________
Renovamos el Correo Yahoo!: ¡100 MB GRATIS!
Nuevos servicios, más seguridad
http://correo.yahoo.es