[gtkada] memory allocation problems in Gtkada 3.4.2?

Emmanuel Briot briot at adacore.com
Fri Mar 21 10:30:26 CET 2014


> It then queried the created object for its parent types, its properties and its signals. This was done for a large number of Gtk widgets, i.e. the ones that derive from Gobject_Record, that are not interfaces and that have a Gtk_New method. I programmed it this way because I don't want to "with" all the required Gtk.xxx packages, to tedious and inflexible. In Gtkada 2.24.2 this all works well.

Basically trading clean code for short code. That's not a style I would personally recommend.
This code is also very unsafe, since you are basically casting types in a very uncontrolled
manner (creating a GObject_Record and putting a gtk_button inside, or other similar things).

I don't think that's a good approach.
This introspection approach in gtk3 was really meant for automatic tools like GUI builders,
not for user code.

The function ada_g_object_new was never meant to be public, documented, or backward compatible
across versions, so this is not something we recommend using.

As far as I can tell, its implementation has not changed in GtkAda 3, but the change might be
in the gtk+ C code, or elsewhere in your application.


Emmanuel


More information about the gtkada mailing list