File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -202,9 +202,7 @@ ll::Expected<> PluginManager::load(ll::plugin::Manifest manifest) {
202202 ExitEngineScope exit;
203203#endif
204204 plugin->onLoad ([](ll::plugin::Plugin& plugin) { return true ; });
205- #ifndef LEGACY_SCRIPT_ENGINE_BACKEND_NODEJS
206205 plugin->onUnload ([](ll::plugin::Plugin& plugin) { return true ; });
207- #endif
208206 plugin->onEnable ([](ll::plugin::Plugin& plugin) { return true ; });
209207 plugin->onDisable ([](ll::plugin::Plugin& plugin) { return true ; });
210208 } catch (const Exception& e) {
@@ -241,16 +239,21 @@ ll::Expected<> PluginManager::unload(std::string_view name) {
241239
242240 auto & scriptEngine = *EngineManager::getEngine (std::string (name));
243241
242+ #ifndef LEGACY_SCRIPT_ENGINE_BACKEND_NODEJS
244243 LLSERemoveTimeTaskData (&scriptEngine);
244+ #endif
245245 LLSERemoveAllEventListeners (&scriptEngine);
246246 LLSERemoveCmdRegister (&scriptEngine);
247247 LLSERemoveCmdCallback (&scriptEngine);
248248 LLSERemoveAllExportedFuncs (&scriptEngine);
249249
250250 scriptEngine.getData ().reset ();
251251 EngineManager::unregisterEngine (&scriptEngine);
252+ #ifdef LEGACY_SCRIPT_ENGINE_BACKEND_NODEJS
253+ NodeJsHelper::stopEngine (&scriptEngine);
254+ #else
252255 scriptEngine.destroy (); // TODO: use unique_ptr to manage the engine.
253- erasePlugin (name);
256+ # endif
254257 return {};
255258 } catch (const std::exception& e) {
256259 return ll::makeStringError (" Failed to unload plugin {}: {}" _tr (name, e.what ()));
You can’t perform that action at this time.
0 commit comments