Author: tabish
Date: Thu Jul 30 21:59:24 2009
New Revision: 799454

URL: http://svn.apache.org/viewvc?rev=799454&view=rev
Log:
64bit OS fix

Modified:
    
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/TimerTaskHeap.cpp

Modified: 
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/TimerTaskHeap.cpp
URL: 
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/TimerTaskHeap.cpp?rev=799454&r1=799453&r2=799454&view=diff
==============================================================================
--- 
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/TimerTaskHeap.cpp
 (original)
+++ 
activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/internal/util/TimerTaskHeap.cpp
 Thu Jul 30 21:59:24 2009
@@ -70,8 +70,12 @@
 
////////////////////////////////////////////////////////////////////////////////
 void TimerTaskHeap::upHeap() {
 
-       std::size_t current = heap.size() - 1;
-       std::size_t parent = ( current - 1 ) / 2;
+    if( heap.size() <= 1 ) {
+        return;  // Can't get any higher than the top.
+    }
+
+    std::size_t current = heap.size() - 1;
+    std::size_t parent = ( current - 1 ) / 2;
 
     while( heap[current]->when < heap[parent]->when) {
 


Reply via email to