failsafe autoloading of libraries for 1.71- plugins

This commit is contained in:
David Anderson
2006-05-11 10:19:09 +00:00
parent 79f86bfabd
commit 6995b182c1
3 changed files with 24 additions and 2 deletions

View File

@ -868,7 +868,7 @@ bool ConvertModuleName(const char *pathString, String &path)
return true;
}
bool LoadModule(const char *shortname, PLUG_LOADTIME now, bool simplify)
bool LoadModule(const char *shortname, PLUG_LOADTIME now, bool simplify, bool noFileBail)
{
char pathString[512];
String path;
@ -888,6 +888,14 @@ bool LoadModule(const char *shortname, PLUG_LOADTIME now, bool simplify)
path.assign(pathString);
}
if (noFileBail)
{
FILE *fp = fopen(path.c_str(), "rb");
if (!fp)
return false;
fclose(fp);
}
CList<CModule, const char *>::iterator a = g_modules.find(path.c_str());
if (a)