releaseActionMap during finalization?
Christian Hofer
christian.hofer at gmx.de
Sun Mar 2 17:39:39 UTC 2003
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
For getting started with Smalltalk, Squeak and Morphic, I tried to write
yet another Counter example - separating the model from the view and
using the new event design which is very similiar to that of
VisualWorks, as far as I can see from the VW Application Development Guide.
It is also there that I read that you have to remove all registered
event handlers (using Object's event mechanism) yourself - quite painful
for someone used to garbage collection. And indeed I found out I
generated lots of entries in the EventManager's ActionMap (though I
confess I hardly understand how it works).
I thought about two ways to handle this problem:
1. I added a finalize-method to my model:
~ CounterModel>>finalize
~ super finalize.
~ self releaseActionMap
As of now I could not see any effects. Is the code wrong or is it just
because the garbage collector has not started its work yet?
2. Maybe it is a viable alternative that my model registers its interest
in the moment of destruction of its morph. But to subsribe for a further
event does not seem to be a very elegant solution in my eyes.
Can anybody help me out?
Christian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAj5iQdsACgkQslE0MLl5sz0/RwCfblgHGcQ7m9ch/9KUXXthQ7ti
BlwAoI44v0PrsRo1HpYVJRsFDKQPbzoa
=eh2X
-----END PGP SIGNATURE-----
More information about the Squeak-dev
mailing list
|