diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-01-13 23:25:17 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-01-13 23:25:17 -0500 |
commit | 141e6fb8181ac3416d311671ab0569f6b73ac4aa (patch) | |
tree | 506a6d452702ec314a528a44051d52d8a50ed00a /libs/pbd | |
parent | 4b3043ccdafbfcc373e2107aa8df92d0db354fbd (diff) |
don't pick up already dead thread request buffers when setting up an event loop
Diffstat (limited to 'libs/pbd')
-rw-r--r-- | libs/pbd/pbd/abstract_ui.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libs/pbd/pbd/abstract_ui.cc b/libs/pbd/pbd/abstract_ui.cc index e186161cf9..b0e26e3cb5 100644 --- a/libs/pbd/pbd/abstract_ui.cc +++ b/libs/pbd/pbd/abstract_ui.cc @@ -80,7 +80,21 @@ AbstractUI<RequestObject>::AbstractUI (const string& name) { Glib::Threads::Mutex::Lock lm (request_buffer_map_lock); for (vector<EventLoop::ThreadBufferMapping>::iterator t = tbm.begin(); t != tbm.end(); ++t) { - request_buffers[t->emitting_thread] = static_cast<RequestBuffer*> (t->request_buffer); + RequestBuffer* rb = static_cast<RequestBuffer*> (t->request_buffer); + + /* it could be dead */ + + if (!rb->dead) { + request_buffers[t->emitting_thread] = rb; + } else { + /* don't delete it, because we have no way to + remove it from the + EventLoop::thread_request_buffers map here, + which means that we will rediscover the + pointer in the future, and indirect to check + "dead". + */ + } } } } |