So, I'm trying to do a bit of optimizations for my codes. And after reading the documentation on Del proc (world) I decided to ask a bit about whether or not what I am doing here is dangerous.
To prevent accidental hangs during world/Del() from preventing shutdown...
world/Del()
var/savefile/S=new("ServerSettings.sav")
S["allowedSize"]<<allowedSize
S["admin"]<<admin
S["moderator"]<<moderator
S["head moderator"]<<head_moderator
S["muted"]<<muted
S["permitted"]<<permitted
S["request"]<<requestPermission
S["decline"]<<declinedPermission
S["accept"]<<acceptedPermission
S["pagerList"]<<pagerList
S["subList"]<<subList
S["worldHost"]<<worldHost
S["serverList"]<<serverList
S["p1"]<<p1
S["p2"]<<p2
S["hub_msg"]<<hub_msg
..()
Problem:
That's the line that shocked me. Primarily because my game hangs every now and then.
Questions:
I'm wondering, is world/Del() ever called other than when the game is shutting down? Is it called when rebooting?
Another thing that I realized is that when people connect, apparently the RAM increases. It was something I spoke of long ago and I was told that the garbage collector may not be doing its job to clean up the variables instantiated. So, I began adding del(var) to some of the codes that contained var/savefile/S in it. The previous version works.
Past experiences and main purpose of this post:
However, the new version does not have del(S) (And it doesn't because there were other random things I did to try and fix this issue that apparently worked as a miracle). And, I am still confused as to what would fix these hangs. Some information on what is really called when could help me deduce a fix on my codes.