gtk_ui_manager_get_accel_group reference



Hi,

I'm not sure if the following problem is a bug in gtk or it is a 'feature':

Running the following code:

GtkUIManager *uiManager = gtk_ui_manager_new();
GtkAccelGroup *accelGroup = gtk_ui_manager_get_accel_group(uiManager);

g_object_unref(accelGroup);
g_object_unref(uiManager);

will result in an error message:
"GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT
(object)' failed"

this error message is given when the refcounter of the uiManager is decreased.
When  gtk_ui_manager_get_accel_group is called it gives back a
reference to the AccelGroup but the ref count of it is not increased.
And from the error message seams that the UIManager still has a
reference to the AccelGroup object and it tries to free it.

This code works correctly if I increment the ref count manually after
getting the pointer of AccelGroup.

Please could you help to identify if this is a bug or a feature?

Thanks,
Csaba



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]