aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstate.cpp')
-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;
+ }
}
/*************************************************