diff options
author | Ian Fan <ianfan0@gmail.com> | 2019-02-16 11:02:15 +0000 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-02-18 15:11:48 -0500 |
commit | 9ff59b7c6bbd46dcbaf5f516705f349a9138261c (patch) | |
tree | 547ca2bae68dc1a87899007d56322425bd0459c5 | |
parent | 8dbd4b98f7b0c8c1c15fc7045b49a2957b993165 (diff) | |
download | sway-9ff59b7c6bbd46dcbaf5f516705f349a9138261c.zip sway-9ff59b7c6bbd46dcbaf5f516705f349a9138261c.tar.gz sway-9ff59b7c6bbd46dcbaf5f516705f349a9138261c.tar.bz2 |
tray: fix memory leaks
-rw-r--r-- | swaybar/tray/item.c | 6 | ||||
-rw-r--r-- | swaybar/tray/watcher.c | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/swaybar/tray/item.c b/swaybar/tray/item.c index 4262d68..4fa6c97 100644 --- a/swaybar/tray/item.c +++ b/swaybar/tray/item.c @@ -299,6 +299,8 @@ void destroy_sni(struct swaybar_sni *sni) { return; } + cairo_surface_destroy(sni->icon); + sd_bus_slot_unref(sni->new_icon_slot); sd_bus_slot_unref(sni->new_attention_icon_slot); sd_bus_slot_unref(sni->new_status_slot); @@ -308,9 +310,11 @@ void destroy_sni(struct swaybar_sni *sni) { free(sni->path); free(sni->status); free(sni->icon_name); - free(sni->icon_pixmap); + list_free_items_and_destroy(sni->icon_pixmap); free(sni->attention_icon_name); + list_free_items_and_destroy(sni->attention_icon_pixmap); free(sni->menu); + free(sni->icon_theme_path); free(sni); } diff --git a/swaybar/tray/watcher.c b/swaybar/tray/watcher.c index 432837d..951a058 100644 --- a/swaybar/tray/watcher.c +++ b/swaybar/tray/watcher.c @@ -186,8 +186,8 @@ struct swaybar_watcher *create_watcher(char *protocol, sd_bus *bus) { goto error; } - sd_bus_slot_set_floating(signal_slot, 1); - sd_bus_slot_set_floating(vtable_slot, 1); + sd_bus_slot_set_floating(signal_slot, 0); + sd_bus_slot_set_floating(vtable_slot, 0); watcher->bus = bus; watcher->hosts = create_list(); |