mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 05:34:54 +00:00
Fixed API unloading
This commit is contained in:
parent
157237e3ef
commit
38c50c2fec
@ -204,10 +204,10 @@ class ServerAPI{
|
||||
}
|
||||
|
||||
public function __destruct(){
|
||||
foreach($this->apiList as $ob){
|
||||
if(is_callable($ob, "__destruct")){
|
||||
foreach($this->apiList as $i => $ob){
|
||||
if(method_exists($ob, "__destruct")){
|
||||
$ob->__destruct();
|
||||
unset($this->apiList[$ob]);
|
||||
unset($this->apiList[$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ class Level{
|
||||
|
||||
public function __destruct(){
|
||||
if(isset($this->level)){
|
||||
$this->save();
|
||||
$this->save(false, false);
|
||||
$this->level->close();
|
||||
unset($this->level);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user