[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: question about alien library unloading
- From: Fabio Mascarenhas <mascarenhas@...>
- Date: Thu, 23 Sep 2010 22:22:29 -0300
Imported functions do not keep a backlink to the libraries they come
from, so libraries would get unloaded while you still keep references
to their functions. I didn't consider unloading libraries as a
priority, so didn't include this backlink. The loaded table does
double duty as a way to keep library objects alive and as a cache to
keep from searching for the library more than once.
Forcing the unloading of a library the way you are doing should not
cause problems if you keep from calling any function from that
library, though. Can you show an example of the code that is causing
problems?
--
Fabio Mascarenhas
On Thu, Sep 23, 2010 at 10:02 PM, Cosmin Apreutesei
<cosmin.apreutesei@gmail.com> wrote:
> Hi,
>
> I was wondering if anyone knows if there's a good reason for alien to
> keep a reference to all libraries it loads (in alient.loaded) from
> garbage collecting.
>
> The reason I ask is because I sometimes get buffer overruns and such
> if I try to unload a library by means of alien.loaded[libname] = nil;
> garbagecollect('collect'). Is there a known problem with this
> approach?
>
> Thanks,
> Cosmin.
>
>