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 675481 - xsettings plugin makes unsafe use of GSettings
xsettings plugin makes unsafe use of GSettings
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: xsettings
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2012-05-04 22:41 UTC by Allison Karlitskaya (desrt)
Modified: 2012-05-30 10:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
xsettings: use g_signal_connect_object with GSettings (2.57 KB, patch)
2012-05-04 22:47 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Allison Karlitskaya (desrt) 2012-05-04 22:41:01 UTC
the xsettings plugin connects signals to GSettings but never disconnects them

simply unreffing the GSettings object is not enough to ensure that signals will never be delivered again.  a signal delivery could already be waiting to be dispatched from the mainloop (holding its own ref).
Comment 1 Allison Karlitskaya (desrt) 2012-05-04 22:47:06 UTC
Created attachment 213476 [details] [review]
xsettings: use g_signal_connect_object with GSettings

This way we automatically disconnect the signal handler when our objects
die (during shutdown).
Comment 2 Bastien Nocera 2012-05-05 12:47:36 UTC
Review of attachment 213476 [details] [review]:

Given the warnings in the docs for g_signal_connect_object(), I'd rather we stored the id's for those signal connect and unhooked them ourselves.
Comment 3 Allison Karlitskaya (desrt) 2012-05-05 14:15:29 UTC
There's no leak in this case because the GSettings object will be destroyed quite soon anyway...
Comment 4 Bastien Nocera 2012-05-30 10:13:28 UTC
Attachment 213476 [details] pushed as 7e87d46 - xsettings: use g_signal_connect_object with GSettings