Deleting an instance

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Deleting an instance

DougEdmunds
Is there a way to delete/remove/kill an instance other than by quitting and
starting Pharo up again?  

In my example, I installed the ContactListEditor package from
http://www.pharocasts.com/2011/02/pharo-gui-with-polymorph.html

After several "ContactListEditor open" doIts, I closed most of the windows.
I inspected "ContactListEditor allInstances"  and it has an array of instances,
one for each 'doIt'. The instances are still 'alive', including those whose
windows were closed.  

If I save and quit Pharo, and restart it, the only instances that are alive are
the ones that have open windows.  



Reply | Threaded
Open this post in threaded view
|

Re: Deleting an instance

laurent laffont
If instance is not referenced anymore, you can:

Smalltalk garbageCollect.

If still here, you can search (but not easy) for references with:

PointerExplorer new openExplorerFor: myInstance.


Laurent.


On Mon, Feb 28, 2011 at 8:54 PM, DougEdmunds <[hidden email]> wrote:
Is there a way to delete/remove/kill an instance other than by quitting and
starting Pharo up again?

In my example, I installed the ContactListEditor package from
http://www.pharocasts.com/2011/02/pharo-gui-with-polymorph.html

After several "ContactListEditor open" doIts, I closed most of the windows.
I inspected "ContactListEditor allInstances"  and it has an array of
instances,
one for each 'doIt'. The instances are still 'alive', including those whose
windows were closed.

If I save and quit Pharo, and restart it, the only instances that are alive
are
the ones that have open windows.





--
View this message in context: http://forum.world.st/Deleting-an-instance-tp3328590p3328590.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: Deleting an instance

Mariano Martinez Peck
Hi. No, in most object oriented languages there is no other way to remove an object that remove all the references to it and then force a garbage collector.

As Laurent suggested, in this case, the better option is to explore the pointers to such objects to see who are ponting to it.

cheers

mariano

On Mon, Feb 28, 2011 at 9:08 PM, laurent laffont <[hidden email]> wrote:
If instance is not referenced anymore, you can:

Smalltalk garbageCollect.

If still here, you can search (but not easy) for references with:

PointerExplorer new openExplorerFor: myInstance.


Laurent.


On Mon, Feb 28, 2011 at 8:54 PM, DougEdmunds <[hidden email]> wrote:
Is there a way to delete/remove/kill an instance other than by quitting and
starting Pharo up again?

In my example, I installed the ContactListEditor package from
http://www.pharocasts.com/2011/02/pharo-gui-with-polymorph.html

After several "ContactListEditor open" doIts, I closed most of the windows.
I inspected "ContactListEditor allInstances"  and it has an array of
instances,
one for each 'doIt'. The instances are still 'alive', including those whose
windows were closed.

If I save and quit Pharo, and restart it, the only instances that are alive
are
the ones that have open windows.





--
View this message in context: http://forum.world.st/Deleting-an-instance-tp3328590p3328590.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.