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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Why is the destructor called multiple times after I declare an object? Date: Sun, 10 Jan 2016 19:18:53 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <293c58ac-4ebd-488a-abcc-b6e88811eec8@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Mon, 11 Jan 2016 02:16:14 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="caa759af2a9c666aec02942f6fe5abd6"; logging-data="14842"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FEkfIVQZ7KF75DuwMhuBvv3RHHa2rzMI=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 In-Reply-To: <293c58ac-4ebd-488a-abcc-b6e88811eec8@googlegroups.com> Cancel-Lock: sha1:6azLYwY9iHpw7Qz8twMJ/2rDOyk= X-Enigmail-Draft-Status: N1110 Xref: news.eternal-september.org comp.lang.ada:29084 Date: 2016-01-10T19:18:53-07:00 List-Id: On 01/10/2016 06:37 PM, Andrew Shvets wrote: > > Why is "Resetting values of Creat to defaults." displaying 6 times as opposed to just twice? ARM 7.6(13-17.1) apply here. Note that Init declares a local variable of the type, which is finalized when Init returns, and that the anonymous object that is the result of the call to Init is finalized after initialization is finished. This gives you 2 calls to Finalize for each variable of the type declared and initialized by a call to Init. Finally you have a call to Finalize for each variable of the type when the program ends. http://www.adaic.org/resources/add_content/standards/12rm/html/RM-7-6.html -- Jeff Carter "Death awaits you all, with nasty, big, pointy teeth!" Monty Python & the Holy Grail 20