| 956 | } |
| 957 | |
| 958 | void ScriptEngine::UnloadPlugin(std::shared_ptr<Plugin>& plugin) |
| 959 | { |
| 960 | if (plugin->IsLoaded()) |
| 961 | { |
| 962 | plugin->Unload(); |
| 963 | LogPluginInfo(plugin, "Unloaded"); |
| 964 | // A GC run is required to clean up all JS objects before the game global context is cleaned up on shut down. |
| 965 | JS_RunGC(_runtime); |
| 966 | } |
| 967 | } |
| 968 | |
| 969 | void ScriptEngine::StartPlugin(std::shared_ptr<Plugin> plugin) |
| 970 | { |