[gtkada] GtkAda signal handlers interface proposal

Emmanuel Briot briot at adacore.com
Thu Apr 28 14:28:30 CEST 2016


>> 
> And this is never an issue in my case. If there is a remote possibility that a signal will be delivered to a prematurely destroyed object, I see no way how something may get leaked. All objects are put into some containers which deal with their referencing/unreferencing. Anything else is bad design, in my view, it should be prevented from happening rather than dealt with at run time.

Right, and that's why I am saying that the current proposal, as it stands, is bad design. It is easy to get leaks, or
even invalid memory access.
Knowing when to call Unref is not so easy (the answer is that you need a Weak_Ref on the emitted widget, and I
would guess that most people don't know what a weak ref is).

> Not really, we don't want to be forced to type conversions when using public interfaces. Especially the conversions that may fail at run-time and crash whole application

Sorry, can't crash your application.
You will get a Constraint_Error (assuming you are passing the wrong type), and such exceptions are handled by GtkAda,
always, before it gives the control back to the C layer. So no crash.


More information about the gtkada mailing list