diff options
Diffstat (limited to 'libs/pbd/pbd')
-rw-r--r-- | libs/pbd/pbd/abstract_ui.cc | 6 | ||||
-rw-r--r-- | libs/pbd/pbd/event_loop.h | 1 |
2 files changed, 6 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 { diff --git a/libs/pbd/pbd/event_loop.h b/libs/pbd/pbd/event_loop.h index f4f57f4c28..b6e07b44de 100644 --- a/libs/pbd/pbd/event_loop.h +++ b/libs/pbd/pbd/event_loop.h @@ -93,6 +93,7 @@ class LIBPBD_API EventLoop static void register_request_buffer_factory (const std::string& target_thread_name, void* (*factory) (uint32_t)); static void pre_register (const std::string& emitting_thread_name, uint32_t num_requests); + static void remove_request_buffer_from_map (void* ptr); private: static Glib::Threads::Private<EventLoop> thread_event_loop; |