From 8fda37bf5b79bf6569e1e375c48e9d74171cb141 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 23 Mar 2010 20:03:47 +0000 Subject: Delete global RNG and the mutex in ~Library_State --- src/libstate/libstate.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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; -- cgit v1.2.3