comp.lang.ada
 help / color / mirror / Atom feed
* Weird controlled behavior - Gnat 3.15p NT
@ 2003-09-04 15:25 Jano
  2003-09-04 15:40 ` Martin Krischik
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Jano @ 2003-09-04 15:25 UTC (permalink / raw)


Hello,

see the following type declarations and lines of code:

   type Object is abstract new 
      Finalization.Controlled with null record;
   type Object_access is access all Object'Class;

   procedure Initialize (This : in out Object) is
   begin
      Trace.Log ("====>");      
   end Initialize;

   procedure Finalize   (This : in out Object) is
   begin
      Trace.Log ("<====");
   end Finalize;

   declare
      -- THIS LINE IS THE RELEVANT ONE.
      Thing : Object_access := 
         new Object'Class'(Object'Class'Input (Stream));
   begin
      null;
   end;

Ok, running normally or stepping with GVD when the line with the
stream reading is executed I get the following log:

====>
<====
<====
<====

Compiled with -O2 and without it if that means something. Consistently
with each object in the stream.

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

Regards,

A. Mosteo.



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2003-09-11  8:23 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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