swarm-support
[Top][All Lists]
Advanced

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

Re: trivia question (drop)


From: Roger M. Burkhart
Subject: Re: trivia question (drop)
Date: Tue, 9 Apr 1996 10:34:15 -0500

Taking your questions in reverse order:

> Do I need to drop them?  Are they big?  I do want everything re-zeroed.

It's a good idea.  For most models with static schedule structures, these
things aren't big, but cleaning up them up is a good idea if you end up
running multiple times in one session.  If you run into a problem dropping
something, it'll still run if you just create the new objects you need and
stop using the old ones, but you'll gradually grow in storage usage.  So
if you find any cleanup you can't make work you need to let us know.

On your runtime error:

> Then when it runs (crashes):
> 
>     *** event raised for error: SourceMessage
>     *** function: _i_Schedule_c__drop(), file: ActionPlan.m, line: 444
>     cannot drop action plan still referenced by an uncompleted activity
>     *** execution terminating due to error

What you need to do is drop the top-level swarm activity before you drop
any of the plans it's currently running.  That should eliminate the
runtime error.  Try it to be sure.  In your example code, try moving the
[swarmActivity drop] before all your other statements:

>     How do you evade these warnings/properly drop these things:
> For each run, think I need to do something like:
> 
>     // drop prior values
>     [simActions drop];
>     [simSchedule drop];
>     [displayActions drop];
>     [displaySchedule drop];
>     [swarmPlan drop];
>     [swarmActivity drop];  // move this before all the others

On the compile-time error:

> compiler says like:
> 
>     main.m:93: warning: multiple declarations for method `drop'
>     ../swarm/include/defobj.h:43: warning: using `-(void)drop'
>     Res.h:16: warning: also found `-drop'
>     Mcr.h:20: warning: also found `-drop'

These warnings are harmless but are occurring because those other header
files (Res.h, Mcr.h) are declaring -drop differently than any of the Swarm
libraries do.  Since there's no longer a valid object after it's dropped,
it's meaningless for drop to return a value; therefore it's declared with
a void return value.  I don't know where Res.h or Mcr.h are defined (they're
not in the Swarm libraries so far as I can find) but just changing their
declaration of -drop to -(void)drop should eliminate the warnings.

Roger


reply via email to

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