]> git.mxchange.org Git - simgear.git/commitdiff
Robustify the SGTimerQueue destructor. There have been reports of
authorandy <andy>
Mon, 3 May 2004 18:43:53 +0000 (18:43 +0000)
committerandy <andy>
Mon, 3 May 2004 18:43:53 +0000 (18:43 +0000)
crashes on deletion.

simgear/structure/event_mgr.cxx

index c7ea2ebd33a5efb0550e45197525187745088e20..1ada33c83abcc80190620c9416079df66f704b01 100644 (file)
@@ -59,7 +59,14 @@ SGTimerQueue::SGTimerQueue(int size)
 
 SGTimerQueue::~SGTimerQueue()
 {
+    for(int i=0; i<_numEntries; i++) {
+        delete _table[i].timer;
+        _table[i].timer = 0;
+    }
+    _numEntries = 0;
     delete[] _table;
+    _table = 0;
+    _tableSize = 0;
 }
 
 void SGTimerQueue::update(double deltaSecs)