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 673978 - Power plugin leaks notifications
Power plugin leaks notifications
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: power
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Richard Hughes
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2012-04-12 10:56 UTC by Chris Coulson
Modified: 2012-06-14 09:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't leak notifications (7.95 KB, patch)
2012-04-12 11:02 UTC, Chris Coulson
needs-work Details | Review
power: Don't leak notifications (7.02 KB, patch)
2012-06-12 12:42 UTC, Bastien Nocera
accepted-commit_now Details | Review
power: Don't leak notifications (7.02 KB, patch)
2012-06-14 04:12 UTC, Matthias Clasen
committed Details | Review

Description Chris Coulson 2012-04-12 10:56:26 UTC
It's only a small leak, but the power plugin leaks notifications, eg:

==8666== 192 bytes in 2 blocks are possibly lost in loss record 8,200 of 9,577
==8666==    at 0x4C29DB4: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8666==    by 0x60D9AA0: g_malloc0 (gmem.c:189)
==8666==    by 0x5038FE9: ??? (in /usr/lib/x86_64-linux-gnu/libnotify.so.4.0.0)
==8666==    by 0x5E6D936: g_type_create_instance (gtype.c:1892)
==8666==    by 0x5E52098: g_object_constructor (gobject.c:1849)
==8666==    by 0x50396BA: ??? (in /usr/lib/x86_64-linux-gnu/libnotify.so.4.0.0)
==8666==    by 0x5E536C3: g_object_newv (gobject.c:1713)
==8666==    by 0x5E53EA5: g_object_new_valist (gobject.c:1830)
==8666==    by 0x5E541B3: g_object_new (gobject.c:1545)
==8666==    by 0x5039732: notify_notification_new (in /usr/lib/x86_64-linux-gnu/libnotify.so.4.0.0)
==8666==    by 0x10E2572F: engine_ups_discharging (gsd-power-manager.c:1242)
==8666==    by 0x10E26B30: engine_device_changed_cb (gsd-power-manager.c:1814)
==8666==    by 0x5E50333: g_cclosure_marshal_VOID__OBJECTv (gmarshal.c:1312)
==8666==    by 0x5E4CEA9: _g_closure_invoke_va (gclosure.c:840)
==8666==    by 0x5E65720: g_signal_emit_valist (gsignal.c:3207)
==8666==    by 0x5E66221: g_signal_emit (gsignal.c:3352)
==8666==    by 0x1145B0A6: ??? (in /usr/lib/x86_64-linux-gnu/libdbus-glib-1.so.2.2.2)
==8666==    by 0x5E4CC81: g_closure_invoke (gclosure.c:777)
==8666==    by 0x5E5DD50: signal_emit_unlocked_R (gsignal.c:3547)
==8666==    by 0x5E66078: g_signal_emit_valist (gsignal.c:3296)
==8666==    by 0x5E66221: g_signal_emit (gsignal.c:3352)
==8666==    by 0x1145B6E5: ??? (in /usr/lib/x86_64-linux-gnu/libdbus-glib-1.so.2.2.2)
==8666==    by 0xF1BF9A5: dbus_connection_dispatch (in /lib/x86_64-linux-gnu/libdbus-1.so.3.5.8)
==8666==    by 0x11454424: ??? (in /usr/lib/x86_64-linux-gnu/libdbus-glib-1.so.2.2.2)
==8666==    by 0x60D3C99: g_main_context_dispatch (gmain.c:2515)
==8666==    by 0x60D405F: g_main_context_iterate.isra.23 (gmain.c:3123)
==8666==    by 0x60D4459: g_main_loop_run (gmain.c:3317)
==8666==    by 0x55E0ECC: gtk_main (gtkmain.c:1165)
==8666==    by 0x403800: main (main.c:464)
Comment 1 Chris Coulson 2012-04-12 11:02:49 UTC
Created attachment 211915 [details] [review]
Don't leak notifications

Should do the trick
Comment 2 Matthias Clasen 2012-04-22 01:27:33 UTC
Review of attachment 211915 [details] [review]:

Patch looks reasonable, but I would just call the helper create_notification.
Just not a good idea to invade the namespace of a library you are already using with static helpers...
Comment 3 Matthias Clasen 2012-06-12 11:18:17 UTC
Review of attachment 211915 [details] [review]:

if we get the namespace issue cleaned up, this should be good to go
Comment 4 Bastien Nocera 2012-06-12 12:42:43 UTC
Created attachment 216201 [details] [review]
power: Don't leak notifications
Comment 5 Matthias Clasen 2012-06-13 16:03:36 UTC
Review of attachment 216201 [details] [review]:

Looks good to me now, fwiw
Comment 6 Matthias Clasen 2012-06-14 00:35:55 UTC
Review of attachment 216201 [details] [review]:

Looks good to me now, fwiw
Comment 7 Matthias Clasen 2012-06-14 04:12:24 UTC
The following fix has been pushed:
721bed3 power: Don't leak notifications
Comment 8 Matthias Clasen 2012-06-14 04:12:27 UTC
Created attachment 216371 [details] [review]
power: Don't leak notifications
Comment 9 Bastien Nocera 2012-06-14 09:27:11 UTC
(In reply to comment #8)
> Created an attachment (id=216371) [details] [review]
> power: Don't leak notifications

When pushing bug fixes, don't forget the gnome-3-4 branch please.