summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2013-09-02 16:21:12 +0200
committerRobin Gareus <robin@gareus.org>2013-09-02 16:21:12 +0200
commitc05ad01b2d3509c9047d320f2c35fbdced648165 (patch)
treeb85d127e62b3a70ab38f6bfd50c9d4cd45c4cc5e
parent66292718a1bde5d333b63c07c19d8d0d187cfc2e (diff)
LV2 external UI handling - revert to <= 3.3. behaviour
Don't ever clean up external UI plugins that use the LV2plug.in URI. only free the memory of the last instance when the plugin is removed or ardour closes.
-rw-r--r--gtk2_ardour/lv2_plugin_ui.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/gtk2_ardour/lv2_plugin_ui.cc b/gtk2_ardour/lv2_plugin_ui.cc
index ed783b0886..1deff32abd 100644
--- a/gtk2_ardour/lv2_plugin_ui.cc
+++ b/gtk2_ardour/lv2_plugin_ui.cc
@@ -115,8 +115,8 @@ LV2PluginUI::on_external_ui_closed(void* controller)
{
//printf("LV2PluginUI::on_external_ui_closed\n");
LV2PluginUI* me = (LV2PluginUI*)controller;
- me->_screen_update_connection.disconnect();
if (me->_lv2->is_external_kx() /* called from plugin's UI_RUN() */) {
+ me->_screen_update_connection.disconnect();
// plugin is free()d in parent function - LV2PluginUI::output_update()
me->_external_ui_ptr = NULL;
}
@@ -374,7 +374,14 @@ LV2PluginUI::~LV2PluginUI ()
delete[] _values;
}
- on_window_hide();
+ _message_update_connection.disconnect();
+ _screen_update_connection.disconnect();
+
+ if (_external_ui_ptr && _lv2->is_external_kx()) {
+ LV2_EXTERNAL_UI_HIDE(_external_ui_ptr);
+ }
+ lv2ui_free();
+ _external_ui_ptr = NULL;
}
int
@@ -478,6 +485,7 @@ LV2PluginUI::on_window_hide()
if (_lv2->is_external_ui()) {
if (!_external_ui_ptr) { return; }
+ if (!_lv2->is_external_kx()) { return ; }
_screen_update_connection.disconnect();
LV2_EXTERNAL_UI_HIDE(_external_ui_ptr);
_external_ui_ptr = NULL;