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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.68.248.4 with SMTP id yi4mr413499pbc.3.1378898481277; Wed, 11 Sep 2013 04:21:21 -0700 (PDT) X-Received: by 10.49.48.38 with SMTP id i6mr29013qen.4.1378898481105; Wed, 11 Sep 2013 04:21:21 -0700 (PDT) Path: border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!b4no11199725pbq.1!news-out.google.com!rn2ni76262pbc.1!nntp.google.com!b4no11199716pbq.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 11 Sep 2013 04:21:21 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=91.7.1.75; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 91.7.1.75 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Reference counting and idempotent finalize From: AdaMagica Injection-Date: Wed, 11 Sep 2013 11:21:21 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Original-Bytes: 1645 Xref: number.nntp.dca.giganews.com comp.lang.ada:183332 Date: 2013-09-11T04:21:21-07:00 List-Id: With the little you show, this looks OK. Be careful about the lifetime of dereferences. Compare Ada Gems http://www.adacore.com/adaanswers/gems/gem-97-reference-counting-in-ada-part-1 and http://www.adacore.com/adaanswers/gems/gem-107-preventing-deallocation-for-reference-counted-types/ Shameless plug: See my implementation http://www.christ-usch-grein.homepage.t-online.de/Ada/Smart_Pointers.html