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 706825 - idle-monitor: Fix a warning when a callback removes the user active watch
idle-monitor: Fix a warning when a callback removes the user active watch
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2013-08-26 20:30 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-08-26 21:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
idle-monitor: Fix a warning when a callback removes the user active watch (1.57 KB, patch)
2013-08-26 20:30 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-08-26 20:30:02 UTC
See patch. This caused spurious META_IS_IDLE_MONITOR failed warnings for me.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-08-26 20:30:04 UTC
Created attachment 253169 [details] [review]
idle-monitor: Fix a warning when a callback removes the user active watch

The user active watch is a one-fire watch, but it is valid in the API
for the callback to explicitly remove the watch itself. In that case,
the watch will be invalid after the user removes it, and the memory
potentially freed. So make sure to not dereference the watch after
the callback is called.
Comment 2 Giovanni Campagna 2013-08-26 20:45:42 UTC
Review of attachment 253169 [details] [review]:

Oh! Now I see why we had the g_object_ref() for the monitor, and the check on the X Alarm instead of a flag in the watch...
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-08-26 21:28:57 UTC
Attachment 253169 [details] pushed as 576cd87 - idle-monitor: Fix a warning when a callback removes the user active watch