From: Daniel P. Berrange Date: Thu, 22 Nov 2012 16:43:57 +0000 (+0000) Subject: Skip deleted timers when calculting next timeout X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=afbd96678e40449ae72cb326a98f9123e53e4aa3;p=people%2Fdariof%2Flibvirt.git 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 --- diff --git a/src/util/event_poll.c b/src/util/event_poll.c index e3907c4f2..7a83a3707 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;