Do not crash if plugins directory is missing

This commit is contained in:
Ted John committed 2020-04-26 14:35:00 +01:00
1 parent 5ba96a34ac
commit 24eafb0a86
1 file changed
+15 -8
+15 -8
View File
@@ -94,14 +94,21 @@ void ScriptEngine::LoadPlugins()
}
}
// Enable hot reloading
_pluginFileWatcher = std::make_unique<FileWatcher>(base);
_pluginFileWatcher->OnFileChanged =
[this](const std::string &path)
{
std::lock_guard<std::mutex> guard(_changedPluginFilesMutex);
_changedPluginFiles.push_back(path);
};
try
{
// Enable hot reloading
_pluginFileWatcher = std::make_unique<FileWatcher>(base);
_pluginFileWatcher->OnFileChanged =
[this](const std::string &path)
{
std::lock_guard<std::mutex> guard(_changedPluginFilesMutex);
_changedPluginFiles.push_back(path);
};
}
catch (const std::exception& e)
{
std::printf("Unable to enable hot reloading of plugins: %s\n", e.what());
}
}
void ScriptEngine::AutoReloadPlugins()