chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] finalizers


From: felix winkelmann
Subject: Re: [Chicken-users] finalizers
Date: Wed, 16 Mar 2005 08:36:19 +0100

On Wed, 16 Mar 2005 04:37:24 +0000, John Lenz <address@hidden> wrote:
> On 03/15/05 14:56:47, John Lenz wrote:
> > I am working on making SWIG support finalizers (I committed some code
> > into CVS today, but it is still in the testing phase).
> >
> > I think I have found a problem.  (I am using 1.92).  I was able to
> > reproduce it with the attached test case.  Inside finalizer.scm, if that
> > (gc #t) line is commented out we get the expected behavior, both objects
> > print out a finalizer line.  If I uncomment that collection between
> > setting the two to null, the finalizer for the second object is never
> > called.  It seems to me like when looking on the finalizer list, the
> > finalizer for the second object is getting dropped or something.
> 

This patch should fix the problem:

diff -rN chicken-old/runtime.c chicken-new/runtime.c
2366a2367,2368
>         if(flist->next != NULL) flist->next->previous = flist->previous;
> 
2367a2370
>         flist->previous = NULL;
7512a7516,7517
>   if(finalizer_list != NULL) finalizer_list->previous = flist;
> 


(the removal of finalizer-list entries was broken)


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]