aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstate.cpp')
-rw-r--r--src/libstate.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstate.cpp b/src/libstate.cpp
index 141e0d1ec..df9d2b519 100644
--- a/src/libstate.cpp
+++ b/src/libstate.cpp
@@ -228,10 +228,10 @@ void Library_State::initialize(const InitializerOptions& args,
if(mutex_factory)
throw Invalid_State("Library_State has already been initialized");
- if(args.thread_safe())
- mutex_factory = modules.mutex_factory();
- else
- mutex_factory = new Default_Mutex_Factory;
+ mutex_factory = modules.mutex_factory(args.thread_safe());
+
+ if(!mutex_factory)
+ throw Invalid_State("Could not acquire a mutex module at init");
allocator_lock = get_mutex();
engine_lock = get_mutex();