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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,40db5229aec061c0 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: access to controlled types Date: 1999/03/01 Message-ID: #1/1 X-Deja-AN: 449693326 Sender: matt@mheaney.ni.net References: <918079635.219550@outpost1.roc.accglobal.net> NNTP-Posting-Date: Sun, 28 Feb 1999 16:35:44 PDT Newsgroups: comp.lang.ada Date: 1999-03-01T00:00:00+00:00 List-Id: Look for my recent post about "smart pointers" in the ACM patterns archive. I show a technique that answers your question. "Terry J. Westley" writes: > In a new version of TASH, I've implmented an interface > to Tcl objects (which are reference counted) with Ada > controlled types. I've been very impressed with how > well this works in GNAT. > > But, there are certain calls in the interface which > return an access to a class-wide type. It's easy to > reference count these newly created objects, but since > the access type is not controlled, the reference counts > don't get decremented. What's the solution? Should I > declare another controlled type which *contains* an > access to the original controlled type? Or, is there > a better solution?