swarm-support
[Top][All Lists]
Advanced

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

Re: ReaperQueue


From: Jayshree Sarma
Subject: Re: ReaperQueue
Date: Mon, 19 Jul 1999 23:06:31 -0400 (EDT)

I did look at the code for deleteAll. The reaperQueue
is not nil, yet both these statements cause the program to seg fault
     [reaperQueue deleteAll];
     [reaperQueue removeAll];

When I comment out this line the program runs fine, no seg fault!  The
problem is that I need to delete the reaper queue. There is only
one member in the reaper queue at that time.

On Mon, 19 Jul 1999, Ken Cline wrote: 

> > 
> > The documentation for deleteAll says that members are
> > dropped as well.  So I do not need the line
> >     [deadBug drop];
> > within the while loop, correct?
> > 
> > I can just have 
> >      [reaperQueue deleteAll];
> > after the while loop.
> > Do I need the following also?
> >     [index drop];
> > 
> 
> Yes, on all counts.  I would probably drop the index first
> and then call `deleteAll', but it shouldn't matter.
> 
> In case you are curious, the `deleteAll' method simply creates
> an index and loops thru all the members removing each from
> the collection and then dropping it (as you probably guessed).
> 
> Here's the code from Collections.m:
>    - (void) deleteAll {
>      id index, member;
> 
>      index = [(id) self begin: scratchZone];
>      while ((member = [index next])) {
>          [index remove];
>          [member drop];
>      }
>      [index drop];
>    }
> 
> 
> _________________________________________________________
> Ken Cline                             address@hidden
> SAIC                                 VOICE (410) 571-0413
> Annapolis, MD                          FAX (301) 261-8427
> 
> 
> 
> 
>                   ==================================
>    Swarm-Support is for discussion of the technical details of the day
>    to day usage of Swarm.  For list administration needs (esp.
>    [un]subscribing), please send a message to <address@hidden>
>    with "help" in the body of the message.
> 
> 


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

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