mirror of
https://github.com/cookiengineer/audacity
synced 2026-04-26 07:53:42 +02:00
Current directory was not being restored properly
This commit is contained in:
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);
|
wxGetApp().FindFilesInPathList(wxT("*.so"), pathList, files);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
wxString saveOldCWD = ::wxGetCwd();
|
||||||
for (i = 0; i < files.GetCount(); i++) {
|
for (i = 0; i < files.GetCount(); i++) {
|
||||||
// As a courtesy to some modules that might be bridges to
|
// As a courtesy to some modules that might be bridges to
|
||||||
// open other modules, we set the current working
|
// open other modules, we set the current working
|
||||||
// directory to be the module's directory.
|
// directory to be the module's directory.
|
||||||
wxString saveOldCWD = ::wxGetCwd();
|
|
||||||
wxString prefix = ::wxPathOnly(files[i]);
|
wxString prefix = ::wxPathOnly(files[i]);
|
||||||
::wxSetWorkingDirectory(prefix);
|
::wxSetWorkingDirectory(prefix);
|
||||||
|
|
||||||
@@ -329,8 +329,9 @@ void ModuleManager::Initialize(CommandHandler &cmdHandler)
|
|||||||
// No need to save status, as we already set kModuleFailed.
|
// No need to save status, as we already set kModuleFailed.
|
||||||
delete module;
|
delete module;
|
||||||
}
|
}
|
||||||
::wxSetWorkingDirectory(saveOldCWD);
|
|
||||||
}
|
}
|
||||||
|
::wxSetWorkingDirectory(saveOldCWD);
|
||||||
|
|
||||||
// After loading all the modules, we may have a registered scripting function.
|
// After loading all the modules, we may have a registered scripting function.
|
||||||
if(scriptFn)
|
if(scriptFn)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user