summaryrefslogtreecommitdiff
path: root/libs/pbd/pool.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-03-11 00:25:10 +0100
committerRobin Gareus <robin@gareus.org>2015-03-11 00:25:10 +0100
commitfe85575a12d8c81e8d2d08b7d91238a88c8febe7 (patch)
treecfc272d4b291673cee546f0a3468f217be46eaef /libs/pbd/pool.cc
parent1a5a48436a2b9627d640736603341e1b21fe45d9 (diff)
fix “no per-thread pool” abort
For some backends the process thread can change (e.g. switch coreaudio headphone + internal speakers) If there are existing x-thread event calls this can lead to the following situation: 1) SessionEvent::operator new 2) audioengine process thread change 3) SessionEvent::operator delete -> crash, wrong thread SessionEvent::operator delete can safely push the event back to the pool for later cleanup..
Diffstat (limited to 'libs/pbd/pool.cc')
-rw-r--r--libs/pbd/pool.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/pbd/pool.cc b/libs/pbd/pool.cc
index b3e5c52e1a..020f296f61 100644
--- a/libs/pbd/pool.cc
+++ b/libs/pbd/pool.cc
@@ -179,10 +179,10 @@ PerThreadPool::create_per_thread_pool (string n, unsigned long isize, unsigned l
* calling create_per_thread_pool in the current thread.
*/
CrossThreadPool*
-PerThreadPool::per_thread_pool ()
+PerThreadPool::per_thread_pool (bool must_exist)
{
CrossThreadPool* p = _key.get();
- if (!p) {
+ if (!p && must_exist) {
fatal << "programming error: no per-thread pool \"" << _name << "\" for thread " << pthread_name() << endmsg;
abort(); /*NOTREACHED*/
}