File tree Expand file tree Collapse file tree
info/bliki/extensions/scribunto/engine/lua Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -638,6 +638,21 @@ public Varargs invoke(Varargs args) {
638638
639639 public void resetEngine () {
640640 globals .setmetatable (new LuaTable ());//reset globals metatable
641+ //unload wiki modules
642+ final LuaTable packagee = globals .get ("package" ).checktable ();
643+ final LuaTable loaded = packagee .get ("loaded" ).checktable ();
644+ LuaValue key = LuaValue .NIL ;
645+ while (true ) {
646+ Varargs next = loaded .next (key );
647+ if ((key = next .arg1 ()).isnil ())
648+ break ;
649+ LuaValue value = next .arg (2 );
650+ if (key .checkjstring ().startsWith ("Module:" ))
651+ loaded .set (key , LuaValue .NIL );//unload module
652+ }
653+
654+ childFrames .clear ();
655+ // compileCache.clear();
641656 }
642657
643658 static class LuaResourceFinder implements ResourceFinder {
You can’t perform that action at this time.
0 commit comments