comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <rieachus@attbi.com>
Subject: Re: Weird controlled behavior - Gnat 3.15p NT
Date: Thu, 04 Sep 2003 21:36:55 GMT
Date: 2003-09-04T21:36:55+00:00	[thread overview]
Message-ID: <3F57B071.5030206@attbi.com> (raw)
In-Reply-To: 5d6fdb61.0309040725.3403aa29@posting.google.com

Jano wrote:

> Now, I would assume that no Finalization could happen without a
> corresponding Initialization, so is this normal? Is something wrong in
> that read way?

No object can be finalized that has not been initialized (or created as 
part of an assignment with adjust), but there are a number of situations 
where even a limited object may be finalized several times.  I won't go 
into the gory details, I think they are all in the Ada 95 Rationale. 
But you should always either design things so that multiple finalization 
is harmless, or you check in the finalization operation whether the 
object has already been finalized.  For example if your Finalize 
procedure contains a call to Unchecked_Deallocation for an access value 
in the object, be sure to pass the value directly, not a copy, so it 
gets set to null.

--
                                           Robert I. Eachus

"As far as I'm concerned, war always means failure." -- Jacques Chirac, 
President of France
"As far as France is concerned, you're right." -- Rush Limbaugh




  parent reply	other threads:[~2003-09-04 21:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-04 15:25 Weird controlled behavior - Gnat 3.15p NT Jano
2003-09-04 15:40 ` Martin Krischik
2003-09-04 18:06 ` Patrice Freydiere
2003-09-04 19:03   ` Jano
2003-09-04 20:57     ` Jano
2003-09-05  8:48     ` Preben Randhol
2003-09-05 13:48       ` Jano
2003-09-04 21:36 ` Robert I. Eachus [this message]
2003-09-05  4:04   ` Randy Brukardt
2003-09-05 13:48     ` Jano
2003-09-05 14:33       ` Dmitry A. Kazakov
2003-09-09  2:01   ` Hyman Rosen
2003-09-09  7:02     ` Jean-Pierre Rosen
2003-09-11  3:40       ` Hyman Rosen
2003-09-09  8:22     ` Dmitry A. Kazakov
2003-09-11  3:46       ` Hyman Rosen
2003-09-11  8:23         ` Dmitry A. Kazakov
2003-09-05  7:10 ` Jean-Pierre Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox