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

Re: Destructors



In article <03c401bf8eb8$435f50f0$8d53e6d8@curl.com>,
P Tucker Withington <ptw@callitrope.com> wrote:
>Finalization is a trap.  It is probably the source of more questions (and
>bugs) in Java than any other "feature".  Your suggestion of block/cleanup is
>the right way to go...

It's also the right way to go in the original poster's application.  He
mentioned that this is for cleaning up foreign resources related to window
system objects.  Presumably, the application knows precisely when it has
removed the window from operation -- they're not expected to stay on the
screen and just disappear spontaneously when GC notices them.  So when the
application deletes the window, it knows that it's appropriate to call the
foreign interface to delete its data.  The Dylan data can be left around
for GC to clean up.

-- 
Barry Margolin, barmar@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.



Follow-Ups: References: