MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / UnregisterPlugin

Method UnregisterPlugin

src/openrct2/scripting/ScriptEngine.cpp:840–859  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

838}
839
840void ScriptEngine::UnregisterPlugin(std::string_view path)
841{
842 try
843 {
844 auto pluginIt = std::find_if(_plugins.begin(), _plugins.end(), [path](const std::shared_ptr<Plugin>& plugin) {
845 return plugin->GetPath() == path;
846 });
847 auto& plugin = *pluginIt;
848
849 StopPlugin(plugin, true);
850 UnloadPlugin(plugin);
851 LogPluginInfo(plugin, "Unregistered");
852
853 _plugins.erase(pluginIt);
854 }
855 catch (const std::exception& e)
856 {
857 _console.WriteLineError(e.what());
858 }
859}
860
861void ScriptEngine::RegisterPlugin(std::string_view path)
862{

Callers

nothing calls this directly

Calls 5

WriteLineErrorMethod · 0.80
endMethod · 0.65
beginMethod · 0.45
GetPathMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected