aboutsummaryrefslogtreecommitdiff
path: root/swaybar/tray/dbus.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-07-16 22:25:28 -0400
committerGitHub <noreply@github.com>2017-07-16 22:25:28 -0400
commit1e13a1fd60dac491a82670826f9960d0b6f8cf7b (patch)
tree78a234d41e62b21f65fe1026db8d005ba36aa864 /swaybar/tray/dbus.c
parent5675a42def79ee8c2bbac32947034f1403aba4f6 (diff)
parente8f589c3dcb11b8f2aa778380381715b680a5ec8 (diff)
Merge pull request #1283 from 4e554c4c/memory_leak
Fix memory leaks in swaybar tray
Diffstat (limited to 'swaybar/tray/dbus.c')
-rw-r--r--swaybar/tray/dbus.c4
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);
}
}