summaryrefslogtreecommitdiff
path: root/src/utils/mutex.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/mutex.h')
-rw-r--r--src/utils/mutex.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/utils/mutex.h b/src/utils/mutex.h
index 7fe3ad69c..d715dddad 100644
--- a/src/utils/mutex.h
+++ b/src/utils/mutex.h
@@ -90,12 +90,14 @@ inline void Mutex::unlock()
inline MutexLocker::MutexLocker(Mutex *const mutex) :
mMutex(mutex)
{
- mMutex->lock();
+ if (mMutex)
+ mMutex->lock();
}
inline MutexLocker::~MutexLocker()
{
- mMutex->unlock();
+ if (mMutex)
+ mMutex->unlock();
}
#endif // UTILS_MUTEX_H