From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2e589dbfe40b0d25 X-Google-Attributes: gid103376,public From: aidan@skinner.demon.co.uk (Aidan Skinner) Subject: Deallocating an object referenced via a classwide access type. Date: 2000/01/11 Message-ID: #1/1 X-Deja-AN: 570976655 X-NNTP-Posting-Host: skinner.demon.co.uk:158.152.76.219 X-Trace: news.demon.co.uk 947555384 nnrp-07:24155 NO-IDENT skinner.demon.co.uk:158.152.76.219 Organization: Insert witty pun here User-Agent: slrn/0.9.5.7 (UNIX) Reply-To: aidan@skinner.demon.co.uk Newsgroups: comp.lang.ada X-Complaints-To: abuse@demon.net Date: 2000-01-11T00:00:00+00:00 List-Id: 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/