comp.lang.ada
 help / color / mirror / Atom feed
From: 402450@cepsz.unizar.es (Jano)
Subject: Weird controlled behavior - Gnat 3.15p NT
Date: 4 Sep 2003 08:25:41 -0700
Date: 2003-09-04T15:25:43+00:00	[thread overview]
Message-ID: <5d6fdb61.0309040725.3403aa29@posting.google.com> (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.



             reply	other threads:[~2003-09-04 15:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-04 15:25 Jano [this message]
2003-09-04 15:40 ` Weird controlled behavior - Gnat 3.15p NT 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
replies disabled

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