mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 21:41:25 +00:00
Config: D-Bus: Don't leak timers
TimerCancel doesn't free the timer: you need TimerFree for that.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user