After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 147592 - Gtk::Settings::get_default() needs extra reference.
Gtk::Settings::get_default() needs extra reference.
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
2.4
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
: 147704 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-07-14 17:29 UTC by Raymond Penners
Modified: 2015-06-06 14:30 UTC
See Also:
GNOME target: ---
GNOME version: 2.5/2.6


Attachments
settings_get_default.patch (1.42 KB, patch)
2004-07-15 09:06 UTC, Murray Cumming
none Details | Review

Description Raymond Penners 2004-07-14 17:29:45 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()".
Comment 1 Murray Cumming 2004-07-15 09:04:28 UTC
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.
Comment 2 Murray Cumming 2004-07-15 09:06:31 UTC
Created attachment 29549 [details] [review]
settings_get_default.patch
Comment 3 Murray Cumming 2004-07-17 10:34:40 UTC
*** Bug 147704 has been marked as a duplicate of this bug. ***