summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2007-12-28 15:47:21 +0200
committerDaniel Stone <daniel@fooishbar.org>2007-12-28 15:50:49 +0200
commit81c5950d0af8d5859f850b98c98a532784e9a757 (patch)
tree96d90b4154892c34c3adc8e2bda4601018e55385 /config
parentd988da6eee8422774dff364050bf431b843a714a (diff)
Config: D-Bus: Don't leak timers
TimerCancel doesn't free the timer: you need TimerFree for that. (cherry picked from commit 25deaa7e6b29b3913b35efa39b9c8b25de5e6d95)
Diffstat (limited to 'config')
-rw-r--r--config/dbus-core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/config/dbus-core.c b/config/dbus-core.c
index eab72a530..9cf153076 100644
--- a/config/dbus-core.c
+++ b/config/dbus-core.c
@@ -76,7 +76,7 @@ teardown(void)
struct config_dbus_core_hook *hook;
if (bus_info.timer) {
- TimerCancel(bus_info.timer);
+ TimerFree(bus_info.timer);
bus_info.timer = NULL;
}
@@ -116,6 +116,8 @@ message_filter(DBusConnection *connection, DBusMessage *message, void *data)
bus_info.connection = NULL;
teardown();
+ if (bus_info.timer)
+ TimerFree(bus_info.timer);
bus_info.timer = TimerSet(NULL, 0, 1, reconnect_timer, NULL);
return DBUS_HANDLER_RESULT_HANDLED;
@@ -186,6 +188,7 @@ static CARD32
reconnect_timer(OsTimerPtr timer, CARD32 time, pointer arg)
{
if (connect_to_bus()) {
+ TimerFree(bus_info.timer);
bus_info.timer = NULL;
return 0;
}