GNOME Bugzilla – Bug 374094
Freeing Gtk owned memory in Gtk::Style::lookup_icon_set
Last modified: 2006-11-23 14:48:12 UTC
Gtk::Style::lookup_icon_set returns a Gtk::IconSet which doesn't copy the internal GtkIconSet object. This results in freeing Gtk's internal copy of the icon set. A second call to Style::lookup_icon_set for the same icon will crash, hang etc... BUG occurs: IconSet set = style->lookup_icon_set(STOCK_APPLICATION); WORKAROUND: GtkIconSet* gset = gtk_style_lookup_icon_set(style->gobj(), STOCK_APPLICATION.get_string().c_str()); IconSet set(gset, true); Will attach a patch.
Created attachment 76410 [details] [review] Patch which fixes lookup_icon_set
Created attachment 76411 [details] Test case for bug and patch.
Using the refreturn optional parameter for _WRAP_METHOD() is probably the simpler fix.
IconSet has neither reference() nor operator bool(). Should those methods be added?
Ah, now I understand. You are saying that the refreturn parameter can't work, because there is no reference() function. OK. Comitted. Thanks.