File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,13 @@ struct EngineOwnData {
85
85
return index;
86
86
}
87
87
inline bool removeUnloadCallback (int pIndex) { return unloadCallbacks.erase (pIndex); }
88
+
89
+ static void clearEngineObjects (ScriptEngine* engine) {
90
+ EngineScope scope (engine);
91
+ auto data = std::static_pointer_cast<EngineOwnData>(engine->getData ());
92
+ data->playerDataDB .clear ();
93
+ // LLSERemoveAllExportedFuncs(engine);
94
+ }
88
95
};
89
96
90
97
// Engine additional data
Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ ll::Expected<> PluginManager::load(ll::mod::Manifest manifest) {
235
235
LLSERemoveCmdCallback (scriptEngine);
236
236
LLSERemoveAllExportedFuncs (scriptEngine);
237
237
238
- scriptEngine-> getData (). reset ( );
238
+ EngineOwnData::clearEngineObjects (scriptEngine );
239
239
EngineManager::unregisterEngine (scriptEngine);
240
240
#ifdef LEGACY_SCRIPT_ENGINE_BACKEND_NODEJS
241
241
NodeJsHelper::stopEngine (scriptEngine);
@@ -268,8 +268,8 @@ ll::Expected<> PluginManager::unload(std::string_view name) {
268
268
LLSERemoveCmdCallback (scriptEngine);
269
269
LLSERemoveAllExportedFuncs (scriptEngine);
270
270
271
+ EngineOwnData::clearEngineObjects (scriptEngine);
271
272
EngineManager::unregisterEngine (scriptEngine);
272
- scriptEngine->getData ().reset ();
273
273
274
274
if (auto plugin = std::static_pointer_cast<Plugin>(getMod (name))) {
275
275
plugin->onUnload ();
You can’t perform that action at this time.
0 commit comments