aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-11-28 05:52:20 -0500
committerJack Lloyd <[email protected]>2016-11-28 05:52:20 -0500
commitc0d847b20cbc1b7d8b29705072e1f9c4715d48ae (patch)
treec142cc407c06ecb5a87a150bfda69f0789326a9c
parent8fce1edc0214b1149cbf4723322714f2e22032eb (diff)
Avoid throwing exception during destructor1.10.14
-rw-r--r--src/alloc/mem_pool/mem_pool.cpp2
-rw-r--r--src/mutex/pthreads/mux_pthr.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/alloc/mem_pool/mem_pool.cpp b/src/alloc/mem_pool/mem_pool.cpp
index 5f53c9ba6..119cabbc1 100644
--- a/src/alloc/mem_pool/mem_pool.cpp
+++ b/src/alloc/mem_pool/mem_pool.cpp
@@ -107,8 +107,10 @@ Pooling_Allocator::Pooling_Allocator(Mutex* m) : mutex(m)
Pooling_Allocator::~Pooling_Allocator()
{
delete mutex;
+ #if 0
if(blocks.size())
throw Invalid_State("Pooling_Allocator: Never released memory");
+ #endif
}
/*
diff --git a/src/mutex/pthreads/mux_pthr.cpp b/src/mutex/pthreads/mux_pthr.cpp
index 165132239..e64fdccf5 100644
--- a/src/mutex/pthreads/mux_pthr.cpp
+++ b/src/mutex/pthreads/mux_pthr.cpp
@@ -45,8 +45,7 @@ Mutex* Pthread_Mutex_Factory::make()
~Pthread_Mutex()
{
- if(pthread_mutex_destroy(&mutex) != 0)
- throw Invalid_State("~Pthread_Mutex: mutex is still locked");
+ pthread_mutex_destroy(&mutex);
}
private:
pthread_mutex_t mutex;