|
Boost-Commit : |
From: chris_at_[hidden]
Date: 2008-05-14 08:17:26
Author: chris_kohlhoff
Date: 2008-05-14 08:17:26 EDT (Wed, 14 May 2008)
New Revision: 45355
URL: http://svn.boost.org/trac/boost/changeset/45355
Log:
Add check for empty heap when determining the minimum wait duration for a
timer queue.
Text files modified:
trunk/boost/asio/detail/timer_queue.hpp | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
Modified: trunk/boost/asio/detail/timer_queue.hpp
==============================================================================
--- trunk/boost/asio/detail/timer_queue.hpp (original)
+++ trunk/boost/asio/detail/timer_queue.hpp 2008-05-14 08:17:26 EDT (Wed, 14 May 2008)
@@ -102,6 +102,8 @@
// Get the time for the timer that is earliest in the queue.
virtual boost::posix_time::time_duration wait_duration() const
{
+ if (heap_.empty())
+ return boost::posix_time::pos_infin;
return Time_Traits::to_posix_duration(
Time_Traits::subtract(heap_[0]->time_, Time_Traits::now()));
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk