Removing instances?

goran.hultgren at bluefish.se goran.hultgren at bluefish.se
Mon Jun 10 10:29:42 UTC 2002


Hi!

Jimmie Houchin <jhouchin at texoma.net> wrote:
> Hello,
> 
> I was playing with Comanche.
> I was browsing the Kom-demo category reading the DisplayCamModule
> documentation. It said select all and doit. I did. It worked.
> 
> Now, how do I get rid of that object instance?
> 
> I did finally find/learn a way to stop the server.
> I did 'inspect instances' on 'ComancheNetService' and then did 
> 'viewer for this value'.
> 
> >From there I could click on the 'stop' method.
> 
> Are there better or other ways of accomplishing this?

Well, first you can see what you got by:

ComancheService services "alt-p/i/I to see what's there and if it's
running."

I actually added this method to ComancheService (class side):

serviceNamed: aString
	^self services at: aString ifAbsent: [nil]

...so that I can get hold of a service by their names. Then you can do:

(ComancheService serviceNamed: 'My service') unregister

The unregister method will first run #stop and then unregister the
service. After a "Smalltalk garbageCollect" it should be gone, at least
if you don't have an inspector on it! :-).

> As I said I could stop the service but I don't know how to remove it. It
> seems I did 'doit' multiple times and I have many instances of a variety
> of services. I would like to remove them. Help. :)

To remove them all:

ComancheService services do: [:s | s unregister ]

...should do it.

> Any help greatly appreciated.
> 
> Jimmie Houchin

regards, Göran



More information about the Squeak-dev mailing list