From 88f1bb6bff3e12118d945e614992ab38f65ddd0d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 10 Mar 2007 16:49:34 +0000 Subject: Throw an assertion error if a NULL timer is added (refs #3, merges [1367]) --- lib/common/Timer.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/common') diff --git a/lib/common/Timer.cpp b/lib/common/Timer.cpp index 4b596931..add827f7 100644 --- a/lib/common/Timer.cpp +++ b/lib/common/Timer.cpp @@ -90,6 +90,7 @@ void Timers::Cleanup() void Timers::Add(Timer& rTimer) { ASSERT(spTimers); + ASSERT(&rTimer); spTimers->push_back(&rTimer); Reschedule(); } @@ -106,11 +107,13 @@ void Timers::Add(Timer& rTimer) void Timers::Remove(Timer& rTimer) { ASSERT(spTimers); + ASSERT(&rTimer); bool restart = true; while (restart) { restart = false; + for (std::vector::iterator i = spTimers->begin(); i != spTimers->end(); i++) { -- cgit v1.2.3