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
This commit is contained in:
Paul Davis 2011-02-04 00:08:36 +00:00
parent ce0465bf2e
commit 97967538f1
2 changed files with 9 additions and 3 deletions

View File

@ -43,7 +43,6 @@ LV2PluginUI::lv2_ui_write(LV2UI_Controller controller,
LV2PluginUI* me = (LV2PluginUI*)controller;
if (!Gtkmm2ext::UI::instance()->caller_is_ui_thread()) {
cerr << "Registering new LV2 UI external thread " << pthread_self() << endl;
PBD::notify_gui_about_thread_creation (pthread_self(), me->_lv2->name());
}

View File

@ -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;