From: andy Date: Mon, 3 May 2004 18:43:53 +0000 (+0000) Subject: Robustify the SGTimerQueue destructor. There have been reports of X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e09164e5b3596b19efc963aca677d6f4bc5a5277;p=simgear.git Robustify the SGTimerQueue destructor. There have been reports of crashes on deletion. --- 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)