From 9138fb9913f6ead7516ac58d24ca81c795c225b9 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 18 Oct 2023 23:18:43 +0200 Subject: [PATCH] VST3: another attempt at sharing has_editor with other instances --- libs/ardour/ardour/vst3_plugin.h | 4 ++-- libs/ardour/vst3_plugin.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/ardour/ardour/vst3_plugin.h b/libs/ardour/ardour/vst3_plugin.h index a241fa70dc..bb4cdc1d7c 100644 --- a/libs/ardour/ardour/vst3_plugin.h +++ b/libs/ardour/ardour/vst3_plugin.h @@ -471,7 +471,7 @@ private: /* ****************************************************************************/ -class LIBARDOUR_API VST3PluginInfo : public PluginInfo +class LIBARDOUR_API VST3PluginInfo : public PluginInfo, public std::enable_shared_from_this { public: VST3PluginInfo (); @@ -482,7 +482,7 @@ public: bool is_instrument () const; PBD::Searchpath preset_search_path () const; - mutable boost::optional has_editor; + boost::optional has_editor; std::shared_ptr m; }; diff --git a/libs/ardour/vst3_plugin.cc b/libs/ardour/vst3_plugin.cc index e6ce1beafa..2ce08cdd83 100644 --- a/libs/ardour/vst3_plugin.cc +++ b/libs/ardour/vst3_plugin.cc @@ -1068,7 +1068,7 @@ VST3PluginInfo::load (Session& session) PluginPtr plugin; Steinberg::VST3PI* plug = new VST3PI (m, unique_id); plugin.reset (new VST3Plugin (session.engine (), session, plug)); - plugin->set_info (PluginInfoPtr (new VST3PluginInfo (*this))); + plugin->set_info (PluginInfoPtr (shared_from_this ())); return plugin; } catch (failed_constructor& err) { ;