aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-23 20:03:47 +0000
committerlloyd <[email protected]>2010-03-23 20:03:47 +0000
commit8fda37bf5b79bf6569e1e375c48e9d74171cb141 (patch)
tree853b3537f9ab2a9792fa97936778946dd5ca1b95 /src
parentda717d6f26dab0cc4fad4dabf53bcff4eb4555e5 (diff)
Delete global RNG and the mutex in ~Library_State
Diffstat (limited to 'src')
-rw-r--r--src/libstate/libstate.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libstate/libstate.cpp b/src/libstate/libstate.cpp
index c62bd08db..1b09a21ee 100644
--- a/src/libstate/libstate.cpp
+++ b/src/libstate/libstate.cpp
@@ -267,9 +267,6 @@ void Library_State::initialize(bool thread_safe)
config_lock = get_mutex();
global_rng_lock = get_mutex();
- global_rng_ptr = 0;
-
- cached_default_allocator = 0;
default_allocator_name = has_mlock() ? "locking" : "malloc";
add_allocator(new Malloc_Allocator);
@@ -325,6 +322,9 @@ Library_State::Library_State()
allocator_lock = config_lock = 0;
cached_default_allocator = 0;
m_algorithm_factory = 0;
+
+ global_rng_lock = 0;
+ global_rng_ptr = 0;
}
/*
@@ -333,6 +333,7 @@ Library_State::Library_State()
Library_State::~Library_State()
{
delete m_algorithm_factory;
+ delete global_rng_ptr;
cached_default_allocator = 0;
@@ -342,6 +343,7 @@ Library_State::~Library_State()
delete allocators[j];
}
+ delete global_rng_lock;
delete allocator_lock;
delete mutex_factory;
delete config_lock;