Properly emit Plugin::DropReferences (1/2)

This commit is contained in:
Robin Gareus 2020-10-05 19:30:06 +02:00
parent df55af6483
commit 7ab664d5a4
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 5 additions and 2 deletions

View File

@ -106,8 +106,6 @@ public:
activate ();
}
virtual void drop_references () {}
virtual std::set<Evoral::Parameter> automatable () const = 0;
virtual std::string describe_parameter (Evoral::Parameter) = 0;
virtual std::string state_node_name () const = 0;

View File

@ -186,6 +186,7 @@ void
LuaProc::drop_references ()
{
lua.collect_garbage ();
Plugin::drop_references ();
}
boost::weak_ptr<Route>

View File

@ -114,6 +114,9 @@ PluginInsert::~PluginInsert ()
void
PluginInsert::drop_references ()
{
if (!_impulseAnalysisPlugin.expired()) {
_impulseAnalysisPlugin.lock()->drop_references ();
}
for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
(*i)->drop_references ();
}
@ -173,6 +176,7 @@ PluginInsert::set_count (uint32_t num)
} else if (num < _plugins.size()) {
uint32_t diff = _plugins.size() - num;
for (uint32_t n= 0; n < diff; ++n) {
_plugins.back()->drop_references ();
_plugins.pop_back();
}
PluginConfigChanged (); /* EMIT SIGNAL */