aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/src/mlocker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/epee/src/mlocker.cpp')
-rw-r--r--contrib/epee/src/mlocker.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/epee/src/mlocker.cpp b/contrib/epee/src/mlocker.cpp
index 5573d591a..09ef861ac 100644
--- a/contrib/epee/src/mlocker.cpp
+++ b/contrib/epee/src/mlocker.cpp
@@ -84,8 +84,8 @@ namespace epee
boost::mutex &mlocker::mutex()
{
- static boost::mutex vmutex;
- return vmutex;
+ static boost::mutex *vmutex = new boost::mutex();
+ return *vmutex;
}
std::map<size_t, unsigned int> &mlocker::map()
{
@@ -108,7 +108,8 @@ namespace epee
mlocker::~mlocker()
{
- unlock(ptr, len);
+ try { unlock(ptr, len); }
+ catch (...) { /* ignore and do not propagate through the dtor */ }
}
void mlocker::lock(void *ptr, size_t len)