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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b33179d12cf6aed7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-05 05:50:55 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Multiple access to one object and deallocation Date: Wed, 05 Nov 2003 14:52:52 +0100 Message-ID: References: NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1068040254 46504936 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:2081 Date: 2003-11-05T14:52:52+01:00 List-Id: On Wed, 05 Nov 2003 07:17:39 -0600, Harry Tucker wrote: >My question is how to count references to an object so it will be >deallocated only after all references have gone out of scope or set to >null? An object reference could exist in several lists at any one time. If "out of scope" means that the access type gets out and if the target type is controlled, then all allocated objects for which Unchecked_Deallocation was not called will be destroyed (AARM 7.6.1). If "out of scope" means an access object, then you need something like smart pointers. For example: http://www.dmitry-kazakov.de/ada/components.htm >What I'm looking for is an easy way to catch my own coding errors so I >don't bleed memory too much by overlooking a reference (access type). Well, let me put it so: reference counting eliminates some errors by introducing new errors. (:-)) --- Regards, Dmitry Kazakov www.dmitry-kazakov.de