diff options
author | 2017-07-16 22:25:28 -0400 | |
---|---|---|
committer | 2017-07-16 22:25:28 -0400 | |
commit | 1e13a1fd60dac491a82670826f9960d0b6f8cf7b (patch) | |
tree | 78a234d41e62b21f65fe1026db8d005ba36aa864 /swaybar/tray/dbus.c | |
parent | Merge pull request #1279 from 4e554c4c/bad_items (diff) | |
parent | Fix memory leaks in swaybar tray (diff) | |
download | sway-1e13a1fd60dac491a82670826f9960d0b6f8cf7b.tar.gz sway-1e13a1fd60dac491a82670826f9960d0b6f8cf7b.tar.zst sway-1e13a1fd60dac491a82670826f9960d0b6f8cf7b.zip |
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) { | |||
108 | 108 | ||
109 | timer_settime(*timer, 0, &time, NULL); | 109 | timer_settime(*timer, 0, &time, NULL); |
110 | 110 | ||
111 | dbus_timeout_set_data(timeout, timer, free); | 111 | dbus_timeout_set_data(timeout, timer, NULL); |
112 | 112 | ||
113 | sway_log(L_DEBUG, "Adding DBus timeout. Interval: %ds %dms", interval_sec, interval_msec); | 113 | sway_log(L_DEBUG, "Adding DBus timeout. Interval: %ds %dms", interval_sec, interval_msec); |
114 | add_timer(*timer, dispatch_timeout, timeout); | 114 | add_timer(*timer, dispatch_timeout, timeout); |
@@ -121,6 +121,8 @@ static void remove_timeout(DBusTimeout *timeout, void *_data) { | |||
121 | 121 | ||
122 | if (timer) { | 122 | if (timer) { |
123 | remove_timer(*timer); | 123 | remove_timer(*timer); |
124 | timer_delete(*timer); | ||
125 | free(timer); | ||
124 | } | 126 | } |
125 | } | 127 | } |
126 | 128 | ||