LV2 extUI handling - amend to previous commit.
authorRobin Gareus <robin@gareus.org>
Mon, 2 Sep 2013 14:57:46 +0000 (16:57 +0200)
committerRobin Gareus <robin@gareus.org>
Mon, 2 Sep 2013 14:57:46 +0000 (16:57 +0200)
gtk2_ardour/lv2_plugin_ui.cc

index 1deff32abd86d6b164ac25b423b2eb8a8556ba5e..c273c1f4ddbf161322a4aa9daeb441d939b60a8e 100644 (file)
@@ -115,11 +115,8 @@ LV2PluginUI::on_external_ui_closed(void* controller)
 {
        //printf("LV2PluginUI::on_external_ui_closed\n");
        LV2PluginUI* me = (LV2PluginUI*)controller;
-       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;
-       }
+       me->_screen_update_connection.disconnect();
+       me->_external_ui_ptr = NULL;
 }
 
 void
@@ -175,7 +172,7 @@ LV2PluginUI::output_update()
                        // clean up external UI if it closes itself via
                        // on_external_ui_closed() during run()
                        //printf("LV2PluginUI::output_update -- UI was closed\n");
-                       _screen_update_connection.disconnect();
+                       //_screen_update_connection.disconnect();
                        _message_update_connection.disconnect();
                        if (_inst) {
                                suil_instance_free((SuilInstance*)_inst);
@@ -485,9 +482,9 @@ LV2PluginUI::on_window_hide()
 
        if (_lv2->is_external_ui()) {
                if (!_external_ui_ptr) { return; }
+               LV2_EXTERNAL_UI_HIDE(_external_ui_ptr);
                if (!_lv2->is_external_kx()) { return ; }
                _screen_update_connection.disconnect();
-               LV2_EXTERNAL_UI_HIDE(_external_ui_ptr);
                _external_ui_ptr = NULL;
                suil_instance_free((SuilInstance*)_inst);
                _inst = NULL;