From afbd96678e40449ae72cb326a98f9123e53e4aa3 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Thu, 22 Nov 2012 16:43:57 +0000 Subject: [PATCH] Skip deleted timers when calculting next timeout It is possible for there to be deleted timers when we calculate the next timeout, and they must be skipped. Signed-off-by: Daniel P. Berrange --- src/util/event_poll.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/event_poll.c b/src/util/event_poll.c index e3907c4f26..7a83a37079 100644 --- a/src/util/event_poll.c +++ b/src/util/event_poll.c @@ -332,6 +332,8 @@ static int virEventPollCalculateTimeout(int *timeout) { EVENT_DEBUG("Calculate expiry of %zu timers", eventLoop.timeoutsCount); /* Figure out if we need a timeout */ for (i = 0 ; i < eventLoop.timeoutsCount ; i++) { + if (eventLoop.timeouts[i].deleted) + continue; if (eventLoop.timeouts[i].frequency < 0) continue; -- GitLab