aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-06-25 12:09:52 +0000
committerlloyd <[email protected]>2006-06-25 12:09:52 +0000
commite6f36f3a64bee29f22f0f3b68a51ab5308a2c186 (patch)
tree5cccda48caa6b2514d5b322525f3919458ab800d
parente536c080164185e79d4e302afddc9e3810a9df23 (diff)
Guard set_timer with a check so it does not set the timer to NULL
-rw-r--r--src/libstate.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libstate.cpp b/src/libstate.cpp
index a2a3bbe9a..a7a6b5f6f 100644
--- a/src/libstate.cpp
+++ b/src/libstate.cpp
@@ -131,8 +131,11 @@ void Library_State::add_allocator(Allocator* allocator)
*************************************************/
void Library_State::set_timer(Timer* new_timer)
{
- delete timer;
- timer = new_timer;
+ if(new_timer)
+ {
+ delete timer;
+ timer = new_timer;
+ }
}
/*************************************************