mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-17 16:40:07 +02:00
Bug 2294 - Scripting: Crash on "Close" command
This commit is contained in:
parent
a072e21b77
commit
ecba41ad2d
@ -364,6 +364,13 @@ MacroCommandsCatalog::MacroCommandsCatalog( const AudacityProject *project )
|
||||
// prefers slightly different parenthesis characters
|
||||
label.Join( XO("(%s)").Format( mNames[i].GET() ), wxT(" ") );
|
||||
|
||||
// Bug 2294. The Close command pulls the rug out from under
|
||||
// batch processing, because it destroys the project.
|
||||
// So it is UNSAFE for scripting, and therefore excluded from
|
||||
// the catalog.
|
||||
if (mNames[i] == "Close")
|
||||
continue;
|
||||
|
||||
commands.push_back(
|
||||
{
|
||||
{
|
||||
|
@ -50,6 +50,9 @@ bool BatchEvalCommand::Apply(const CommandContext & context)
|
||||
// Uh oh, I need to build a catalog, expensively
|
||||
// Maybe it can be built in one long-lived place and shared among command
|
||||
// objects instead?
|
||||
// The catolog though may change during a session, as it includes the
|
||||
// names of macro commands - so the long-lived copy will need to
|
||||
// be refreshed after macros are added/deleted.
|
||||
MacroCommandsCatalog catalog(&context.project);
|
||||
|
||||
wxString macroName = GetString(wxT("MacroName"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user