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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,591cf01fd1138c66,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!g47g2000cwa.googlegroups.com!not-for-mail From: "Lucretia" Newsgroups: comp.lang.ada Subject: Strange factory for wxAda Date: 17 Oct 2005 08:59:01 -0700 Organization: http://groups.google.com Message-ID: <1129564741.462159.308620@g47g2000cwa.googlegroups.com> NNTP-Posting-Host: 194.74.199.42 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1129564747 27087 127.0.0.1 (17 Oct 2005 15:59:07 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 17 Oct 2005 15:59:07 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.0 Symantec_Web_Security (3.0.1.74), 1.0 C2100-0050414028 (NetCache NetApp/5.5R5) Complaints-To: groups-abuse@google.com Injection-Info: g47g2000cwa.googlegroups.com; posting-host=194.74.199.42; posting-account=G-J9fgwAAADgpzBiEyy5tO4f8MX5fbpw Xref: g2news1.google.com comp.lang.ada:5748 Date: 2005-10-17T08:59:01-07:00 List-Id: Hi, I've another question for you all... In wxAda it is often necessary to generate an Ada "wrapper" instance for a particular C++ pointer. An example would be when an event is triggered from the C++ side that needs to be propogated to the Ada side so that the correct event handler is called. An event could be wxEvent or any class derived from it. These events are of unknown type on the C++ side and so all I can do is generate a type from a factory on the Ada side using the C++ wx class name, so "wxEvent" will create an Event_Type, "wxSpinEvent" will create a Spin_Event_Type, etc. The problem is, when I generate these types, I new the instance and this instance doesn't get desroyed until the application exits. When the event handler has been called and the event handled, should I: 1) call Finalize on the pointer explicitly (I've seen CLAW do this)? But I didn't realise that you could call Finalize explicitly. 2) call an Unchecked_Deallocation on this pointer? Has anyone else found themselves in a similar situation? Thanks, Luke.