mirror of
https://github.com/cookiengineer/audacity
synced 2025-04-30 15:49:41 +02:00
Fix crash in script pipe caused by commit 9eb9104
This commit is contained in:
parent
4c3729040f
commit
02d5e6c597
@ -27,9 +27,8 @@
|
||||
#include "../commands/Command.h"
|
||||
|
||||
CommandHandler::CommandHandler()
|
||||
: mCurrentContext(std::make_unique<CommandContext>
|
||||
(*GetActiveProject()))
|
||||
{ }
|
||||
{
|
||||
}
|
||||
|
||||
CommandHandler::~CommandHandler()
|
||||
{
|
||||
@ -38,7 +37,6 @@ CommandHandler::~CommandHandler()
|
||||
void CommandHandler::SetProject(AudacityProject *)
|
||||
{
|
||||
// TODO: Review if the extend command handling is ever utilized
|
||||
// mCurrentContext->proj = proj;
|
||||
}
|
||||
|
||||
void CommandHandler::OnReceiveCommand(AppCommandEvent &event)
|
||||
@ -54,11 +52,12 @@ void CommandHandler::OnReceiveCommand(AppCommandEvent &event)
|
||||
// Then apply it to current application & project. Note that the
|
||||
// command may change the context - for example, switching to a
|
||||
// different project.
|
||||
CommandContext context{ *GetActiveProject() };
|
||||
auto result = GuardedCall<bool>( [&] {
|
||||
return cmd->Apply(*mCurrentContext);
|
||||
return cmd->Apply( context );
|
||||
});
|
||||
wxUnusedVar(result);
|
||||
|
||||
// Redraw the project
|
||||
mCurrentContext->project.RedrawProject();
|
||||
context.project.RedrawProject();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user