]> git.mxchange.org Git - simgear.git/blobdiff - simgear/structure/event_mgr.cxx
Robustify the SGTimerQueue destructor. There have been reports of
[simgear.git] / 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)