comp.lang.ada
 help / color / mirror / Atom feed
* Deallocating an object referenced via a classwide access type.
@ 2000-01-11  0:00 Aidan Skinner
  2000-01-10  0:00 ` Matthew Heaney
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Aidan Skinner @ 2000-01-11  0:00 UTC (permalink / raw)


Mkay.

I have the following package:

with Ada.Finalization;
package Foo_Package is 

  type Foo is new Ada.Finalization.Controlled with private;

  type Foo_Access is access all Foo'Class;

  type New_Foo is new Foo with private;

private

  type Foo is new Ada.Finalization.Controlled with record
     My_Thing : Foo_Access := null;
  end Foo;

  type New_Foo is new Foo with null record;

  procedure Deallocate (Object : in out Foo);

end Foo_Package;

How do I deallocate My_Thing?

I can't use Ada.Unchecked_Deallocation, since My_Thing might be a Foo
or it might be a New_Foo.

A quick search through the RM and various text books has proven
fruitless. :((

- Aidan

-- 
"I consider your own preference for not breeding to be a service
to usenet."
http://www.skinner.demon.co.uk/aidan/




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

end of thread, other threads:[~2000-01-11  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-11  0:00 Deallocating an object referenced via a classwide access type Aidan Skinner
2000-01-10  0:00 ` Matthew Heaney
2000-01-11  0:00   ` Matthew Heaney
2000-01-11  0:00 ` Laurent Guerby
2000-01-11  0:00 ` Tucker Taft

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