comp.lang.ada
 help / color / mirror / Atom feed
From: aidan@skinner.demon.co.uk (Aidan Skinner)
Subject: Deallocating an object referenced via a classwide access type.
Date: 2000/01/11
Date: 2000-01-11T00:00:00+00:00	[thread overview]
Message-ID: <slrn87l2rt.15e.aidan@skinner.demon.co.uk> (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/




             reply	other threads:[~2000-01-11  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-11  0:00 Aidan Skinner [this message]
2000-01-10  0:00 ` Deallocating an object referenced via a classwide access type Matthew Heaney
2000-01-11  0:00   ` Matthew Heaney
2000-01-11  0:00 ` Laurent Guerby
2000-01-11  0:00 ` Tucker Taft
replies disabled

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