From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ee06257af909a235 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!217.73.144.44.MISMATCH!ecngs!feeder.ecngs.de!newsfeed.freenet.de!news.albasani.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Finalization of static package variables Date: Tue, 15 May 2007 19:41:47 -0500 Organization: Jacob's private Usenet server Message-ID: References: <4640f20b$1@news.upm.es> <1178723724.958486.24820@u30g2000hsc.googlegroups.com> <464244d8$1@news.upm.es> <1178753228.648765.89390@e65g2000hsc.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1179275985 9599 69.95.181.76 (16 May 2007 00:39:45 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 16 May 2007 00:39:45 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Xref: g2news1.google.com comp.lang.ada:15805 Date: 2007-05-15T19:41:47-05:00 List-Id: "Jeffrey R. Carter" wrote in message news:cyx0i.45276$n_.17025@attbi_s21... ... > The task in JEWL is a singleton task declared in the specification of a > library-level private package. This task keeps track of how many frames > have been created and doesn't end until they've all been destroyed. The > frame in the subprogram is destroyed when it is finalized when the > subprogram returns; the frame in the package won't be finalized until > the task ends. With the frame in a subprogram, the call to Close isn't > strictly necessary (though it's a good idea). With the frame in the > package, the call to Close is necessary. Otherwise, the task won't end > until the frame is finalized, and the frame won't be finalized until the > task ends. Unfortunately, that isn't possible if the owner of the window (frame) is aborted or is terminated by an unexpected exception. (You can have a handler in the latter case, but that's easy to forget.) We tried that approach first with Claw, but the number of support calls about programs that wouldn't terminate (and a lot of time wasted on our end before we realized that we just had another instance of the same old user error) quickly proved the silliness of that strategy. Even if JEWL isn't technically broken in this case, it is unnecessarily fragile. BTW, the OP should know that Gnat 3.15p does this sort of finalization correctly; some earlier versions didn't, but a lot of Claw bug reports cleaned that up... Randy.