GNOME Bugzilla – Bug 673978
Power plugin leaks notifications
Last modified: 2012-06-14 09:27:11 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)
Created attachment 211915 [details] [review] Don't leak notifications Should do the trick
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...
Review of attachment 211915 [details] [review]: if we get the namespace issue cleaned up, this should be good to go
Created attachment 216201 [details] [review] power: Don't leak notifications
Review of attachment 216201 [details] [review]: Looks good to me now, fwiw
The following fix has been pushed: 721bed3 power: Don't leak notifications
Created attachment 216371 [details] [review] power: Don't leak notifications
(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.