[Box Backup-commit] COMMIT r1367 - box/chris/general/lib/common

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Mon, 05 Mar 2007 00:02:03 +0000


Author: chris
Date: 2007-03-05 00:02:03 +0000 (Mon, 05 Mar 2007)
New Revision: 1367

Modified:
   box/chris/general/lib/common/Timer.cpp
Log:
Throw an assertion error if a NULL timer is added


Modified: box/chris/general/lib/common/Timer.cpp
===================================================================
--- box/chris/general/lib/common/Timer.cpp	2007-03-05 00:01:38 UTC (rev 1366)
+++ box/chris/general/lib/common/Timer.cpp	2007-03-05 00:02:03 UTC (rev 1367)
@@ -90,6 +90,7 @@
 void Timers::Add(Timer& rTimer)
 {
 	ASSERT(spTimers);
+	ASSERT(&rTimer);
 	spTimers->push_back(&rTimer);
 	Reschedule();
 }
@@ -106,11 +107,13 @@
 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++)
 		{