webengine/osswebengine/WebCore/platform/Timer.cpp
changeset 11 c8a366e56285
parent 5 10e98eab6f85
child 40 8bfb9186a8b8
--- a/webengine/osswebengine/WebCore/platform/Timer.cpp	Thu Aug 27 07:44:59 2009 +0300
+++ b/webengine/osswebengine/WebCore/platform/Timer.cpp	Thu Sep 24 12:53:48 2009 +0300
@@ -228,7 +228,13 @@
 {
     ASSERT(m_nextFireTime != 0);
     checkHeapIndex();
-    push_heap(TimerHeapIterator(0), TimerHeapIterator(m_heapIndex + 1));
+    #if PLATFORM(SYMBIAN)
+    // check for valid heap index
+    if(m_heapIndex < static_cast<int>(timerHeap->size()))
+    #endif
+        {
+        push_heap(TimerHeapIterator(0), TimerHeapIterator(m_heapIndex + 1));
+        }
     checkHeapIndex();
 }
 
@@ -377,6 +383,23 @@
     updateSharedTimer();
 }
 
+#if PLATFORM(SYMBIAN)
+void TimerBase::deleteTimerHeap()
+{
+    if (timerHeap)
+    {
+        while (!timerHeap->isEmpty())
+        {
+            TimerBase* timer = timerHeap->first();
+            timer->m_nextFireTime = 0;
+            timer->heapDeleteMin();        
+        }
+        delete timerHeap ;
+        timerHeap = NULL ;
+    }
+}
+#endif
+
 // ----------------
 
 bool isDeferringTimers()