summaryrefslogtreecommitdiff
path: root/libs/pbd/pbd/abstract_ui.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-01-14 10:53:32 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2016-01-14 10:53:32 -0500
commit35807a19293564afb742e99371d7e07b26cc8619 (patch)
tree7798aa486f8fc413b2ac32d7b2275e046eec4418 /libs/pbd/pbd/abstract_ui.cc
parent077c65cc2a2a058505256ea7d4c58508f3a30593 (diff)
fully clean up request buffers when a thread dies
Diffstat (limited to 'libs/pbd/pbd/abstract_ui.cc')
-rw-r--r--libs/pbd/pbd/abstract_ui.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/pbd/pbd/abstract_ui.cc b/libs/pbd/pbd/abstract_ui.cc
index e186161cf9..3fa1f64770 100644
--- a/libs/pbd/pbd/abstract_ui.cc
+++ b/libs/pbd/pbd/abstract_ui.cc
@@ -54,7 +54,7 @@ cleanup_request_buffer (void* ptr)
* a request. If the UI has finished processing requests, then
* we will leak this buffer object.
*/
-
+ DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("thread \"%1\" exits: marking request buffer as dead @ %2\n", pthread_name(), rb));
rb->dead = true;
}
@@ -246,9 +246,13 @@ AbstractUI<RequestObject>::handle_ui_requests ()
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1/%2 deleting dead per-thread request buffer for %3 @ %4\n",
event_loop_name(), pthread_name(), i->second));
cerr << event_loop_name() << " noticed that a buffer was dead\n";
+ /* remove it from the EventLoop static map of all request buffers */
+ EventLoop::remove_request_buffer_from_map ((*i).second);
+ /* delete it */
delete (*i).second;
RequestBufferMapIterator tmp = i;
++tmp;
+ /* remove it from this thread's list of request buffers */
request_buffers.erase (i);
i = tmp;
} else {