mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-21 16:11:11 +01:00
Bug 2294 - Scripting: Crash on "Close" command
This commit is contained in:
@@ -364,6 +364,13 @@ MacroCommandsCatalog::MacroCommandsCatalog( const AudacityProject *project )
|
|||||||
// prefers slightly different parenthesis characters
|
// prefers slightly different parenthesis characters
|
||||||
label.Join( XO("(%s)").Format( mNames[i].GET() ), wxT(" ") );
|
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(
|
commands.push_back(
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ bool BatchEvalCommand::Apply(const CommandContext & context)
|
|||||||
// Uh oh, I need to build a catalog, expensively
|
// Uh oh, I need to build a catalog, expensively
|
||||||
// Maybe it can be built in one long-lived place and shared among command
|
// Maybe it can be built in one long-lived place and shared among command
|
||||||
// objects instead?
|
// 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);
|
MacroCommandsCatalog catalog(&context.project);
|
||||||
|
|
||||||
wxString macroName = GetString(wxT("MacroName"));
|
wxString macroName = GetString(wxT("MacroName"));
|
||||||
|
|||||||
Reference in New Issue
Block a user