mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-01 16:19:43 +02:00
Current directory was not being restored properly
This commit is contained in:
parent
eca5c25ec0
commit
9987ac2020
5
src/ModuleManager.cpp
Normal file → Executable file
5
src/ModuleManager.cpp
Normal file → Executable file
@ -253,11 +253,11 @@ void ModuleManager::Initialize(CommandHandler &cmdHandler)
|
||||
wxGetApp().FindFilesInPathList(wxT("*.so"), pathList, files);
|
||||
#endif
|
||||
|
||||
wxString saveOldCWD = ::wxGetCwd();
|
||||
for (i = 0; i < files.GetCount(); i++) {
|
||||
// As a courtesy to some modules that might be bridges to
|
||||
// open other modules, we set the current working
|
||||
// directory to be the module's directory.
|
||||
wxString saveOldCWD = ::wxGetCwd();
|
||||
wxString prefix = ::wxPathOnly(files[i]);
|
||||
::wxSetWorkingDirectory(prefix);
|
||||
|
||||
@ -329,8 +329,9 @@ void ModuleManager::Initialize(CommandHandler &cmdHandler)
|
||||
// No need to save status, as we already set kModuleFailed.
|
||||
delete module;
|
||||
}
|
||||
::wxSetWorkingDirectory(saveOldCWD);
|
||||
}
|
||||
::wxSetWorkingDirectory(saveOldCWD);
|
||||
|
||||
// After loading all the modules, we may have a registered scripting function.
|
||||
if(scriptFn)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user