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,4bd6ca8f7a1eb225 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.205.127.148 with SMTP id ha20mr7340599bkc.6.1322538069533; Mon, 28 Nov 2011 19:41:09 -0800 (PST) MIME-Version: 1.0 From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Class with task destructor Date: Mon, 28 Nov 2011 21:40:13 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <30604696.94.1322013045135.JavaMail.geo-discussion-forums@yqzz20> <28489797.1088.1322188495508.JavaMail.geo-discussion-forums@yqf20> <1hi4mzlr17z6m.1t1rj0maa8vmt.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1322538015 8622 69.95.181.76 (29 Nov 2011 03:40:15 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 29 Nov 2011 03:40:15 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Path: y3ni1221bkw.0!nntp.google.com!news2.google.com!goblin3!goblin.stu.neva.ru!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!usenet-fr.net!feed.ac-versailles.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!jacob-sparre.dk!ada-dk.org!.POSTED!not-for-mail Xref: news2.google.com comp.lang.ada:14711 Date: 2011-11-28T21:40:13-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1hi4mzlr17z6m.1t1rj0maa8vmt.dlg@40tude.net... > On Thu, 24 Nov 2011 18:34:55 -0800 (PST), Rego, P. wrote: ... >> 1) Why should I need to use Finalize (instead of direct T.Primary.Finish >> in Destruct)? > > Because Finalize is always called when the object is being finalized. Which includes when the object goes away because of an exception being raised somewhere, a task being aborted, or some containing object being deallocated. Using Finalize makes your object far less fragile than trying to destroy it manually (and also allows it to be used anywhere Ada allows an object, rather than just as a stand-alone entity). Claw provides a Destroy routine so that windows can be closed early, but there is never a requirement to call it. Randy.