13
0

don't pick up already dead thread request buffers when setting up an event loop

This commit is contained in:
Paul Davis 2016-01-13 23:25:17 -05:00
parent 4b3043ccda
commit 141e6fb818

View File

@ -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".
*/
}
}
}
}