diff options
author | Robin Gareus <robin@gareus.org> | 2013-08-25 15:54:43 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2013-08-25 16:21:18 +0200 |
commit | 4cdb018cae8580581359274d6397779b79263bdc (patch) | |
tree | 0fa539c0909e80a0297946df648b8e57e3c3cd90 /gtk2_ardour/lv2_plugin_ui.cc | |
parent | 1421a34e52862b614f280c751a12893e4abecf88 (diff) |
free memory of external plugins on GUI close (major mem leak).
There is at least one known plugin that has a problem with this
(custom thread race condition) but it also crashes in other hosts:
http://www.drumgizmo.org/wiki/doku.php?id=bugs&do=showcaselink&showid=8&project=drumgizmo
tested to be working with various nedko, falktx and x42 plugins
Diffstat (limited to 'gtk2_ardour/lv2_plugin_ui.cc')
-rw-r--r-- | gtk2_ardour/lv2_plugin_ui.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gtk2_ardour/lv2_plugin_ui.cc b/gtk2_ardour/lv2_plugin_ui.cc index f9b15714f6..6f22ce5182 100644 --- a/gtk2_ardour/lv2_plugin_ui.cc +++ b/gtk2_ardour/lv2_plugin_ui.cc @@ -116,6 +116,10 @@ LV2PluginUI::on_external_ui_closed(void* controller) LV2PluginUI* me = (LV2PluginUI*)controller; me->_screen_update_connection.disconnect(); me->_external_ui_ptr = NULL; +#if 1 + suil_instance_free((SuilInstance*)me->_inst); + me->_inst = NULL; +#endif } void @@ -450,9 +454,12 @@ LV2PluginUI::on_window_hide() if (_external_ui_ptr) { LV2_EXTERNAL_UI_HIDE(_external_ui_ptr); - //slv2_ui_instance_get_descriptor(_inst)->cleanup(_inst); - //_external_ui_ptr = NULL; - //_screen_update_connection.disconnect(); + _screen_update_connection.disconnect(); + _external_ui_ptr = NULL; +#if 1 + suil_instance_free((SuilInstance*)_inst); + _inst = NULL; +#endif } else { lv2ui_free(); } |