mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-19 12:17:17 -04:00
Catching potential errors in __gc methods when persisting computers.
This commit is contained in:
parent
bf9de41a7b
commit
4e8a48a56f
@ -413,6 +413,9 @@ class NativeLuaArchitecture(val machine: api.machine.Machine) extends Architectu
|
|||||||
case e: LuaRuntimeException =>
|
case e: LuaRuntimeException =>
|
||||||
OpenComputers.log.warning("Could not persist computer.\n" + e.toString + (if (e.getLuaStackTrace.isEmpty) "" else "\tat " + e.getLuaStackTrace.mkString("\n\tat ")))
|
OpenComputers.log.warning("Could not persist computer.\n" + e.toString + (if (e.getLuaStackTrace.isEmpty) "" else "\tat " + e.getLuaStackTrace.mkString("\n\tat ")))
|
||||||
nbt.removeTag("state")
|
nbt.removeTag("state")
|
||||||
|
case e: LuaGcMetamethodException =>
|
||||||
|
OpenComputers.log.warning("Could not persist computer.\n" + e.toString)
|
||||||
|
nbt.removeTag("state")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Limit memory again.
|
// Limit memory again.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user