comp.lang.ada
 help / color / mirror / Atom feed
* Strange factory for wxAda
@ 2005-10-17 15:59 Lucretia
  2005-10-18  0:36 ` Randy Brukardt
  0 siblings, 1 reply; 5+ messages in thread
From: Lucretia @ 2005-10-17 15:59 UTC (permalink / 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.




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-10-24 13:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-17 15:59 Strange factory for wxAda Lucretia
2005-10-18  0:36 ` Randy Brukardt
2005-10-18 16:28   ` Lucretia
2005-10-18 21:53     ` Randy Brukardt
2005-10-24 13:09       ` Lucretia

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