comp.lang.ada
 help / color / mirror / Atom feed
From: "Lucretia" <lucretia9@lycos.co.uk>
Subject: Strange factory for wxAda
Date: 17 Oct 2005 08:59:01 -0700
Date: 2005-10-17T08:59:01-07:00	[thread overview]
Message-ID: <1129564741.462159.308620@g47g2000cwa.googlegroups.com> (raw)

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.




             reply	other threads:[~2005-10-17 15:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-17 15:59 Lucretia [this message]
2005-10-18  0:36 ` Strange factory for wxAda Randy Brukardt
2005-10-18 16:28   ` Lucretia
2005-10-18 21:53     ` Randy Brukardt
2005-10-24 13:09       ` Lucretia
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox