GNOME Bugzilla – Bug 147592
Gtk::Settings::get_default() needs extra reference.
Last modified: 2015-06-06 14:30:29 UTC
After using Gtk::Settings::get_default() in my code, the application suddenly started crashing randomly. What I think is happening is that my app is indirectly destructing the settings (because of the RefPtr), but it is not the owner of the settings. At least, that is what I conclude by looking into the sources of GTK+ (the GtkSettings object is attached to a GdkScreen, and should not be freed) IMHO, Gtk::Settings::get_default() should not return a Glib::RefPtr. PS: The same holds for "get_for_screen()".
Objects that are reference-counted are not owned by any one object - they are reference-counted. We are just missing a reference. This patch should fix it. I have committed it to cvs. I see no problem with Gtk::Settings::get_for_screen(), but tell us if there is.
Created attachment 29549 [details] [review] settings_get_default.patch
*** Bug 147704 has been marked as a duplicate of this bug. ***