[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Loadlib work 5,1
- From: Ignacio Castaño <castanyo@...>
- Date: Fri, 3 Sep 2004 02:31:39 +0200 (CEST)
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