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-Thread: 103376,591cf01fd1138c66 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Tue, 18 Oct 2005 16:49:50 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1129564741.462159.308620@g47g2000cwa.googlegroups.com> <1129652902.862979.44810@f14g2000cwb.googlegroups.com> Subject: Re: Strange factory for wxAda Date: Tue, 18 Oct 2005 16:53:53 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4952.2800 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4952.2800 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-OHZzj0+6nFoBpgKQn4wD6r/f7k7rqdBXdyRbVT0two71oQfsJEQ0GB+WN9awokYM19+HeisI7pmvPiL!L+pIDSie8G0B2pl1/qXwcNADExte/r0Qvo79JmVe0xEpYr+oPuik+3Oqc6wlcmB85SUJVsOiGxMG X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:5786 Date: 2005-10-18T16:53:53-05:00 List-Id: "Lucretia" wrote in message news:1129652902.862979.44810@f14g2000cwb.googlegroups.com... > > Randy Brukardt wrote: > > "Lucretia" wrote in message > > news:1129564741.462159.308620@g47g2000cwa.googlegroups.com... ... > > careful that it can be called multiple times on the same object without > > incident, but you ought to do that anyway (it can be called multiple times > > in some Abort scenarios, so it's best to protected against that). > > At the moment, I'm not even thinking about tasking, this will have to > be thought about later, when I turn my event handler into some sort of > protected object, which will be tricky considering that that is called > from C++ :-/ Careful. You really need to think about tasking early on, because it is extremely hard to graft it on afterwards. Now, you may decide that it simply isn't worth it, and decide to restrict the uses to one task (as GWindows does, for instance), but it's best to decide on the approach right away. > > > 2) call an Unchecked_Deallocation on this pointer? > > > > If your library is allocating the object, then its OK for your library to > > deallocate it. (And that will call Finalize, of course). But you should > > never deallocate something that your user(s) allocated. And you may need to > > reference count the object (if the pointers can be copied), or better, give > > the pointers a limited type (they'll have to be a record in that case, > > wrapping the pointer). > > Well, all objects are derived from a root Limited_Cotnrolled tagged > type, if that's what you mean? So, I can copy the access types, but not > the instances. Unless you mean create a "smart pointer" type to > encapsulate the wxAda *_Type'Access types with? That's what I meant. If you want to do the allocation yourself, you really don't want any dangling references. So you might want to do whatever it takes to avoid them (that means making the type limited and not using any access types in your client interface). In any case, this seems like a tough problem, which I'm glad I don't need to solve. :-) Randy.