1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-01-13 08:05:52 +01:00
This commit is contained in:
Leland Lucius
2015-06-10 21:59:02 -05:00
parent e532ea2ca0
commit b000568d49

View File

@@ -208,10 +208,11 @@ bool LadspaEffectsModule::RegisterPlugin(PluginManagerInterface & pm, const wxSt
// As a courtesy to some plug-ins that might be bridges to // As a courtesy to some plug-ins that might be bridges to
// open other plug-ins, we set the current working // open other plug-ins, we set the current working
// directory to be the plug-in's directory. // directory to be the plug-in's directory.
wxString envpath;
wxString saveOldCWD = ::wxGetCwd(); bool hadpath = wxGetEnv(wxT("PATH"), &envpath);
wxString prefix = ::wxPathOnly(path); wxSetEnv(wxT("PATH"), f.GetPath() + wxFILE_SEP_PATH + envpath);
::wxSetWorkingDirectory(prefix); wxString saveOldCWD = f.GetCwd();
f.SetCwd();
int index = 0; int index = 0;
LADSPA_Descriptor_Function mainFn = NULL; LADSPA_Descriptor_Function mainFn = NULL;
@@ -236,7 +237,8 @@ bool LadspaEffectsModule::RegisterPlugin(PluginManagerInterface & pm, const wxSt
lib.Unload(); lib.Unload();
} }
::wxSetWorkingDirectory(saveOldCWD); wxSetWorkingDirectory(saveOldCWD);
hadpath ? wxSetEnv(wxT("PATH"), envpath) : wxUnsetEnv(wxT("PATH"));
return index > 0; return index > 0;
} }
@@ -1507,6 +1509,13 @@ bool LadspaEffect::Load()
return true; return true;
} }
wxFileName f = mPath;
wxString envpath;
bool hadpath = wxGetEnv(wxT("PATH"), &envpath);
wxSetEnv(wxT("PATH"), f.GetPath() + wxFILE_SEP_PATH + envpath);
wxString saveOldCWD = f.GetCwd();
f.SetCwd();
LADSPA_Descriptor_Function mainFn = NULL; LADSPA_Descriptor_Function mainFn = NULL;
if (mLib.Load(mPath, wxDL_NOW)) if (mLib.Load(mPath, wxDL_NOW))
@@ -1526,6 +1535,9 @@ bool LadspaEffect::Load()
mLib.Unload(); mLib.Unload();
} }
wxSetWorkingDirectory(saveOldCWD);
hadpath ? wxSetEnv(wxT("PATH"), envpath) : wxUnsetEnv(wxT("PATH"));
return false; return false;
} }