summaryrefslogtreecommitdiff
path: root/libs/pbd
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-02-04 00:08:36 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-02-04 00:08:36 +0000
commit97967538f1c275cc830d52f4c4d1f5034f67e90e (patch)
tree249cc86038cc05f4e4e16444b973a5355b969310 /libs/pbd
parentce0465bf2efb3d16476d998f74600a2c65d715a4 (diff)
final tweaks for LV2 UI fixes: (a) add per-key destructors for the request buffers so that they die with the thread (b) remove debug output
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@8697 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd')
-rw-r--r--libs/pbd/pbd/abstract_ui.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/libs/pbd/pbd/abstract_ui.cc b/libs/pbd/pbd/abstract_ui.cc
index 6ea8d2b940..f8fd947685 100644
--- a/libs/pbd/pbd/abstract_ui.cc
+++ b/libs/pbd/pbd/abstract_ui.cc
@@ -9,11 +9,18 @@
using namespace std;
+template<typename RequestBuffer> void
+cleanup_request_buffer (void* ptr)
+{
+ RequestBuffer* rb = (RequestBuffer*) ptr;
+ delete rb;
+}
+
template <typename RequestObject>
AbstractUI<RequestObject>::AbstractUI (string name, bool with_signal_pipes)
: BaseUI (name, with_signal_pipes)
{
- if (pthread_key_create (&thread_request_buffer_key, 0)) {
+ if (pthread_key_create (&thread_request_buffer_key, cleanup_request_buffer<RequestBuffer>)) {
cerr << _("cannot create thread request buffer key") << endl;
throw failed_constructor();
}
@@ -46,7 +53,7 @@ AbstractUI<RequestObject>::register_thread_with_request_count (pthread_t thread_
}
RequestBuffer* b = new RequestBuffer (num_requests);
-
+
{
Glib::Mutex::Lock lm (request_buffer_map_lock);
request_buffers[thread_id] = b;