mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Future all-memory impossible cleanup
This commit is contained in:
parent
ed42ba5176
commit
46ded9e675
2 changed files with 33 additions and 0 deletions
10
server.php
10
server.php
|
|
@ -23,7 +23,17 @@ while(true){
|
|||
if($server->start() !== true){
|
||||
break;
|
||||
}else{
|
||||
console("[INFO] Cleaning up...");
|
||||
hard_unset($server);
|
||||
$excludeList = array("GLOBALS", "_FILES", "_COOKIE", "_POST", "_GET", "excludeList");
|
||||
foreach(get_defined_vars() as $key => $value){
|
||||
if(!in_array($key, $excludeList)){
|
||||
$$key = null;
|
||||
unset($$key);
|
||||
}
|
||||
}
|
||||
$server = null;
|
||||
unset($server);
|
||||
console("[NOTICE] The server is restarting... (".gc_collect_cycles()." cycles collected)", true, true, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue