diff options
author | Calvin Lee <cyrus296@gmail.com> | 2017-07-16 17:59:16 -0700 |
---|---|---|
committer | Calvin Lee <cyrus296@gmail.com> | 2017-07-16 19:06:24 -0700 |
commit | e8f589c3dcb11b8f2aa778380381715b680a5ec8 (patch) | |
tree | 78a234d41e62b21f65fe1026db8d005ba36aa864 /swaybar/tray/dbus.c | |
parent | 5675a42def79ee8c2bbac32947034f1403aba4f6 (diff) |
Fix memory leaks in swaybar tray
Diffstat (limited to 'swaybar/tray/dbus.c')
-rw-r--r-- | swaybar/tray/dbus.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/swaybar/tray/dbus.c b/swaybar/tray/dbus.c index 2a8cefc7..f562baeb 100644 --- a/swaybar/tray/dbus.c +++ b/swaybar/tray/dbus.c @@ -108,7 +108,7 @@ static dbus_bool_t add_timeout(DBusTimeout *timeout, void *_data) { timer_settime(*timer, 0, &time, NULL); - dbus_timeout_set_data(timeout, timer, free); + dbus_timeout_set_data(timeout, timer, NULL); sway_log(L_DEBUG, "Adding DBus timeout. Interval: %ds %dms", interval_sec, interval_msec); add_timer(*timer, dispatch_timeout, timeout); @@ -121,6 +121,8 @@ static void remove_timeout(DBusTimeout *timeout, void *_data) { if (timer) { remove_timer(*timer); + timer_delete(*timer); + free(timer); } } |