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 Received: by 10.68.35.68 with SMTP id f4mr2995529pbj.5.1322029228572; Tue, 22 Nov 2011 22:20:28 -0800 (PST) Path: lh20ni8023pbb.0!nntp.google.com!news1.google.com!postnews.google.com!e2g2000vbb.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Class with task destructor Date: Tue, 22 Nov 2011 22:14:34 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <30604696.94.1322013045135.JavaMail.geo-discussion-forums@yqzz20> <80027d05-2740-4899-b43a-514100ec9bd2@p16g2000yqd.googlegroups.com> NNTP-Posting-Host: 68.4.246.214 Mime-Version: 1.0 X-Trace: posting.google.com 1322029228 28282 127.0.0.1 (23 Nov 2011 06:20:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 23 Nov 2011 06:20:28 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e2g2000vbb.googlegroups.com; posting-host=68.4.246.214; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: ARLUEHNKC X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; HPDTDF; BRI/1; .NET4.0C; BRI/2; AskTbARS/5.12.2.16749),gzip(gfe) Xref: news1.google.com comp.lang.ada:19062 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2011-11-22T22:14:34-08:00 List-Id: On Nov 22, 9:04=A0pm, Yannick Duch=EAne (Hibou57) wrote: > Le Wed, 23 Nov 2011 03:44:39 +0100, Adam Beneschan a > =E9crit:> The language rules say that Unchecked_Deallocation doesn't forc= e tasks > > to terminate. > > But it should, because unless I missed something, it seems in this exampl= e > case at least, this lead to a dangling reference. *Any* use of Unchecked_Deallocation can lead to a dangling reference, which is why it's called Unchecked. But also note that the language explicitly says that if you use Unchecked_Deallocation on an object that contains tasks, the object might not actually disappear (13.11.2(9)). I'm not sure if there are language rules that say that the object *must* not be deallocated immediately in a case like this, where the task has a discriminant that refers to the object being freed. I don't have time to look into it at the moment. Maybe someone else knows? -- Adam