1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 16:49:41 +02:00

Fix memleak. Not observed, just saw it when browsing the code.

This commit is contained in:
lllucius 2014-06-10 06:03:51 +00:00
parent 6605ac07e2
commit a12818a912

View File

@ -1084,22 +1084,25 @@ bool CommandManager::HandleTextualCommand(wxString & Str, wxUint32 flags, wxUint
// Not one of the singleton commands.
// We could/should try all the list-style commands.
// instead we only try the effects.
EffectArray *effects;
AudacityProject * proj;
proj = GetActiveProject();
AudacityProject * proj = GetActiveProject();
if( !proj )
return false;
bool result = false;
int effectFlags = ALL_EFFECTS | CONFIGURED_EFFECT;
effects = EffectManager::Get().GetEffects(effectFlags);
for(i=0; i<effects->GetCount(); i++) {
wxString effectName = (*effects)[i]->GetEffectName();
if( Str.IsSameAs( effectName ))
{
return proj->OnEffect( effectFlags, (*effects)[i] );
EffectArray *effects = EffectManager::Get().GetEffects(effectFlags);
if (effects) {
for(i=0; i<effects->GetCount(); i++) {
wxString effectName = (*effects)[i]->GetEffectName();
if( Str.IsSameAs( effectName ))
{
result = proj->OnEffect( effectFlags, (*effects)[i] );
break;
}
}
delete effects;
}
return false;
return result;
}
void CommandManager::GetCategories(wxArrayString &cats)