mirror of
https://github.com/cookiengineer/audacity
synced 2026-01-12 23:55:50 +01:00
Fix for bug #1023
This commit is contained in:
@@ -208,11 +208,12 @@ 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;
|
||||||
wxDynamicLibrary lib;
|
wxDynamicLibrary lib;
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user