GtkIconFactory adaptor: Added a destroy_object function

The GtkIconFactory adaptor adds the factory to the default
with gtk_icon_factory_add_default() at post create time, now
we remove it at destroy object time.

Enabled the create-objects test for GtkIconFactory which now
passes again.
This commit is contained in:
Tristan Van Berkom 2013-04-06 15:42:03 +09:00
parent af4ff2a61f
commit 2f05655cd3
3 changed files with 10 additions and 2 deletions

View File

@ -7856,6 +7856,15 @@ glade_gtk_icon_factory_post_create (GladeWidgetAdaptor * adaptor,
gtk_icon_factory_add_default (GTK_ICON_FACTORY (object));
}
void
glade_gtk_icon_factory_destroy_object (GladeWidgetAdaptor * adaptor,
GObject *object)
{
gtk_icon_factory_remove_default (GTK_ICON_FACTORY (object));
GWA_GET_CLASS (G_TYPE_OBJECT)->destroy_object (adaptor, object);
}
static void
glade_gtk_icon_factory_read_sources (GladeWidget * widget, GladeXmlNode * node)
{

View File

@ -2300,6 +2300,7 @@ embedded in another object</_tooltip>
<glade-widget-class name="GtkIconFactory" generic-name="iconfactory" _title="Icon Factory"
toplevel="True">
<post-create-function>glade_gtk_icon_factory_post_create</post-create-function>
<destroy-object-function>glade_gtk_icon_factory_destroy_object</destroy-object-function>
<read-widget-function>glade_gtk_icon_factory_read_widget</read-widget-function>
<write-widget-function>glade_gtk_icon_factory_write_widget</write-widget-function>
<set-property-function>glade_gtk_icon_factory_set_property</set-property-function>

View File

@ -99,8 +99,6 @@ main (int argc,
if (G_TYPE_IS_INSTANTIATABLE (adaptor_type) && !G_TYPE_IS_ABSTRACT (adaptor_type) &&
/* FIXME: Status Icon crashes at dispose time unrealizing it's GtkTrayIcon without a window */
adaptor_type != GTK_TYPE_STATUS_ICON &&
/* FIXME: Icon factory adds itself to the default but never removes itself */
adaptor_type != GTK_TYPE_ICON_FACTORY &&
/* FIXME: FileChooserButton leaks a GTask which will crash in the following test */
adaptor_type != GTK_TYPE_FILE_CHOOSER_BUTTON &&
/* FIXME: App choosers leak some async operations after finalization, causing subsequent tests to fail */