aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Ian Fan <ianfan0@gmail.com>2019-02-16 11:02:15 +0000
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-02-18 15:11:48 -0500
commit9ff59b7c6bbd46dcbaf5f516705f349a9138261c (patch)
tree547ca2bae68dc1a87899007d56322425bd0459c5
parenttray: when a service is lost, remove all matching items (diff)
downloadsway-9ff59b7c6bbd46dcbaf5f516705f349a9138261c.tar.gz
sway-9ff59b7c6bbd46dcbaf5f516705f349a9138261c.tar.zst
sway-9ff59b7c6bbd46dcbaf5f516705f349a9138261c.zip
tray: fix memory leaks
-rw-r--r--swaybar/tray/item.c6
-rw-r--r--swaybar/tray/watcher.c4
2 files changed, 7 insertions, 3 deletions
diff --git a/swaybar/tray/item.c b/swaybar/tray/item.c
index 4262d687..4fa6c97b 100644
--- a/swaybar/tray/item.c
+++ b/swaybar/tray/item.c
@@ -299,6 +299,8 @@ void destroy_sni(struct swaybar_sni *sni) {
299 return; 299 return;
300 } 300 }
301 301
302 cairo_surface_destroy(sni->icon);
303
302 sd_bus_slot_unref(sni->new_icon_slot); 304 sd_bus_slot_unref(sni->new_icon_slot);
303 sd_bus_slot_unref(sni->new_attention_icon_slot); 305 sd_bus_slot_unref(sni->new_attention_icon_slot);
304 sd_bus_slot_unref(sni->new_status_slot); 306 sd_bus_slot_unref(sni->new_status_slot);
@@ -308,9 +310,11 @@ void destroy_sni(struct swaybar_sni *sni) {
308 free(sni->path); 310 free(sni->path);
309 free(sni->status); 311 free(sni->status);
310 free(sni->icon_name); 312 free(sni->icon_name);
311 free(sni->icon_pixmap); 313 list_free_items_and_destroy(sni->icon_pixmap);
312 free(sni->attention_icon_name); 314 free(sni->attention_icon_name);
315 list_free_items_and_destroy(sni->attention_icon_pixmap);
313 free(sni->menu); 316 free(sni->menu);
317 free(sni->icon_theme_path);
314 free(sni); 318 free(sni);
315} 319}
316 320
diff --git a/swaybar/tray/watcher.c b/swaybar/tray/watcher.c
index 432837d0..951a0589 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) {
186 goto error; 186 goto error;
187 } 187 }
188 188
189 sd_bus_slot_set_floating(signal_slot, 1); 189 sd_bus_slot_set_floating(signal_slot, 0);
190 sd_bus_slot_set_floating(vtable_slot, 1); 190 sd_bus_slot_set_floating(vtable_slot, 0);
191 191
192 watcher->bus = bus; 192 watcher->bus = bus;
193 watcher->hosts = create_list(); 193 watcher->hosts = create_list();