From e09164e5b3596b19efc963aca677d6f4bc5a5277 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 3 May 2004 18:43:53 +0000 Subject: [PATCH] Robustify the SGTimerQueue destructor. There have been reports of crashes on deletion. --- simgear/structure/event_mgr.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/simgear/structure/event_mgr.cxx b/simgear/structure/event_mgr.cxx index c7ea2ebd..1ada33c8 100644 --- a/simgear/structure/event_mgr.cxx +++ b/simgear/structure/event_mgr.cxx @@ -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) -- 2.39.5