prevent events to be called when script server is gone.

This commit is contained in:
gnembon committed 2021-05-28 13:50:50 -03:00
1 parent 566b6c394b
commit bd689b418a
2 files changed
+3 -1

No files matched your search

@@ -469,9 +469,10 @@ public class CarpetScriptServer
public void onClose()
{
CarpetEventServer.Event.SHUTDOWN.onTick();
for (ScriptHost host : modules.values())
for (CarpetScriptHost host : modules.values())
{
host.onClose();
events.removeAllHostEvents(host);
}
}