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

Re: Destructors



In article <38DABC13.A00BEAE3@quiotix.com>,
Jeffrey B. Siegal <jbs@quiotix.com> wrote:
>Barry Margolin wrote:
>> 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.
>
>Maybe.  Some GUI models allow you to temporarily remove a window from
>the screen, for example when it is when it is iconified or minimized,
>and then put it back later.  In this case, you want the window resources
>to go away when: a) the windows has been removed from the screen, and b)
>the resources are no longer reachable, so there is no possibility that
>the window can be put back.

The API's distinguish between deleting a window permanently and merely
unmapping it.  The application would only delete the resources in the
former case.

Remember that these window systems are primarily accessed from languages
that *don't* have garbage collection.  Since a C/C++ application has to be
able to know when it's appropriate to destroy the application data related
to a window, an application written in Lisp/Scheme/Dylan would presumably
be given the same opportunity.

-- 
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: