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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,64ced24a7e89252e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!newsread.com!newsprint.newsread.com!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Unchecked deallocation question Date: Thu, 25 Nov 2004 09:35:48 +0100 Organization: None Message-ID: <4540106.PdnsrBBvo5@linux1.krischik.com> References: <41A4AAFF.5060407@mailinator.com> Reply-To: martin@krischik.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1101372266 00 6999 DZV3XdQlmh+JS8rY 041125 08:44:26 X-Complaints-To: usenet-abuse@t-online.de X-ID: S9kzkQZDYeF6Hd2bDYnOXp-PAjSZ4-GBxgM7N73nOJK1p3vxM4hTcC User-Agent: KNode/0.8.0 Xref: g2news1.google.com comp.lang.ada:6452 Date: 2004-11-25T09:35:48+01:00 List-Id: Alex R. Mosteo wrote: > declare > It : Derived_Access := new Derived; > begin > Free (Root_Access (It)); -- <-- THIS DEALLOCATION I'M ASKING > end; You should carefully thing if you really need it. Unlike C/C++ the following is actually valid: declare It : Root'Class := Derived'(...); begin ... end; It is more or less the same concept as: declare It : String := "Hello World!"; begin ... end; 3 Month into learning Ada I began to fully understand what an "indefinte type" is and what it can do fro you - and then I remove more then 80% of all my access types. With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com