Fix leaks from the plug-in constructor
Leak report
344 (72 direct, 272 indirect) bytes in 1 blocks are definitely lost in loss record 8,024 of 8,580
at 0x53BC6A0: g_type_create_instance (gtype.c:1928)
by 0x539EF87: g_object_new_internal (gobject.c:2606)
by 0x53A082D: g_object_new_with_properties (gobject.c:2769)
by 0x53A166E: g_object_new (gobject.c:2415)
by 0x70D312C: pulseaudio_dialog_new (pulseaudio-dialog.c:475)
by 0x70D1C11: pulseaudio_plugin_construct (pulseaudio-plugin.c:549)
by 0x48634A4: xfce_panel_plugin_realize (xfce-panel-plugin.c:1002)
[...snip...]
1,528 (1,072 direct, 456 indirect) bytes in 1 blocks are definitely lost in loss record 8,372 of 8,580
at 0x484BC13: calloc (vg_replace_malloc.c:1675)
by 0x71256C3: pa_xmalloc0 (xmalloc.c:74)
by 0x71D39F4: pa_hashmap_new_full (hashmap.c:61)
by 0x70CCB96: pulseaudio_volume_connect (pulseaudio-volume.c:628)
by 0x70CCD8D: pulseaudio_volume_init (pulseaudio-volume.c:208)
by 0x53BC768: g_type_create_instance (gtype.c:1951)
by 0x539EF87: g_object_new_internal (gobject.c:2606)
by 0x53A082D: g_object_new_with_properties (gobject.c:2769)
by 0x53A166E: g_object_new (gobject.c:2415)
by 0x70CE566: pulseaudio_volume_new (pulseaudio-volume.c:1160)
by 0x70D1CBF: pulseaudio_plugin_construct (pulseaudio-plugin.c:566)
by 0x48634A4: xfce_panel_plugin_realize (xfce-panel-plugin.c:1002)
[...snip...]
2,048 bytes in 1 blocks are still reachable in loss record 8,553 of 8,713
at 0x484BE40: realloc (vg_replace_malloc.c:1800)
by 0x5441701: g_realloc (gmem.c:171)
by 0x542755B: g_hash_table_realloc_key_or_value_array (ghash.c:329)
by 0x542755B: realloc_arrays (ghash.c:672)
by 0x542769B: g_hash_table_resize (ghash.c:825)
by 0x5427D7B: g_hash_table_maybe_resize (ghash.c:865)
by 0x5427D7B: g_hash_table_insert_node (ghash.c:1318)
by 0x5427FDE: g_hash_table_insert_internal (ghash.c:1577)
by 0x5428CA4: g_hash_table_add (ghash.c:1666)
by 0x53B3B10: handler_new (gsignal.c:604)
by 0x53B3B10: g_signal_connect_data (gsignal.c:2512)
by 0x70D7247: pulseaudio_notify_new (pulseaudio-notify.c:286)
by 0x70D1CF7: pulseaudio_plugin_construct (pulseaudio-plugin.c:582)
by 0x48634A4: xfce_panel_plugin_realize (xfce-panel-plugin.c:1002)
[...snip...]
Testing
- No issues were detected when testing the patch with Valgrind