From: porton@ex-code.com (Victor Porton)
Subject: Re: Pitfall: freeing access discriminants
Date: Thu, 13 Feb 2003 17:07:59 +0500
Date: 2003-02-13T13:32:25+00:00 [thread overview]
Message-ID: <E18jI9n-00047O-00@porton.narod.ru> (raw)
In-Reply-To: E18jGE0-0003dI-00@porton.narod.ru
In article <E18jGE0-0003dI-00@porton.narod.ru>,
porton@ex-code.com (Victor Porton) writes:
> type Integer_Access is access Integer;
>
> type T(D: access Integer) is Ada.Limited_Controlled with null record;
>
> procedure Finalize(Object: in out T) is
> -- Error: cannot convert access discriminant to non-local access type
> D: Integer_Access := Integer_Access(Object.D);
> begin
> Free(D);
> end;
>
> What to do? It seems being a serious deficiency in Ada or there are a
> workaround?
I found a solution myself:
Base: Base_Element_Access := Object.Base.all'Unchecked_Access;
next prev parent reply other threads:[~2003-02-13 12:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-13 10:04 Pitfall: freeing access discriminants Victor Porton
2003-02-13 12:07 ` Victor Porton [this message]
2003-02-13 13:42 ` Preben Randhol
2003-02-13 17:40 ` Stephen Leake
2003-02-13 19:24 ` Victor Porton
-- strict thread matches above, loose matches on Subject: below --
2003-02-13 12:41 Grein, Christoph
2003-02-13 13:38 ` Victor Porton
2003-02-13 20:49 ` tmoran
2003-02-13 21:17 ` Simon Wright
2003-02-14 4:16 ` tmoran
2003-02-14 21:30 ` Simon Wright
2003-02-14 8:28 ` Victor Porton
2003-02-22 19:00 ` Robert A Duff
2003-02-14 6:02 Grein, Christoph
2003-02-14 6:21 Grein, Christoph
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox