From bb2e171ea5d4d84035cd27db4dd51b0e10c9b281 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 10 Jul 2011 17:16:58 +0000 Subject: [PATCH] fix crash for slv-based build when destroying an LV2 plugin GUI; assuming for now that that lilv does this better git-svn-id: svn://localhost/ardour2/branches/3.0@9831 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/lv2_plugin_ui.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/lv2_plugin_ui.cc b/gtk2_ardour/lv2_plugin_ui.cc index 8624249351..68038ebd20 100644 --- a/gtk2_ardour/lv2_plugin_ui.cc +++ b/gtk2_ardour/lv2_plugin_ui.cc @@ -274,11 +274,13 @@ LV2PluginUI::lv2ui_free() suil_instance_free((SuilInstance*)_inst); #else SLV2UIInstance inst = (SLV2UIInstance)_inst; - const LV2UI_Descriptor* ui_desc = slv2_ui_instance_get_descriptor(inst); - LV2UI_Handle ui_handle = slv2_ui_instance_get_handle(inst); - - if (ui_desc) { - ui_desc->cleanup(ui_handle); + if (inst) { + const LV2UI_Descriptor* ui_desc = slv2_ui_instance_get_descriptor(inst); + LV2UI_Handle ui_handle = slv2_ui_instance_get_handle(inst); + + if (ui_desc) { + ui_desc->cleanup(ui_handle); + } } #endif