diff options
author | Chris Wilson <chris+github@qwirx.com> | 2007-03-10 16:49:34 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2007-03-10 16:49:34 +0000 |
commit | 88f1bb6bff3e12118d945e614992ab38f65ddd0d (patch) | |
tree | fc305e1325a623661b5ca8bc965235d58cf68524 | |
parent | a80c159997a4ec2eb79ec06f9363d73c3189ee95 (diff) |
Throw an assertion error if a NULL timer is added (refs #3, merges [1367])
-rw-r--r-- | lib/common/Timer.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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<Timer*>::iterator i = spTimers->begin(); i != spTimers->end(); i++) { |