1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-21 22:12:58 +02:00

Simplify memory management in PluginManager

This commit is contained in:
Paul Licameli
2021-06-18 13:08:36 -04:00
parent 4770b1f0a4
commit 8fda526577
24 changed files with 96 additions and 192 deletions

View File

@@ -1327,9 +1327,11 @@ void NyqBench::OnLargeIcons(wxCommandEvent & e)
void NyqBench::OnGo(wxCommandEvent & e)
{
// No need to delete...EffectManager will do it
mEffect = new NyquistEffect(wxT("Nyquist Effect Workbench"));
const PluginID & ID = EffectManager::Get().RegisterEffect(mEffect);
auto pEffect =
std::make_unique<NyquistEffect>(L"Nyquist Effect Workbench");
mEffect = pEffect.get();
const PluginID & ID =
EffectManager::Get().RegisterEffect(std::move(pEffect));
mEffect->SetCommand(mScript->GetValue());
mEffect->RedirectOutput();