Fixed API unloading

This commit is contained in:
Shoghi Cervantes 2013-06-08 01:40:13 +02:00
parent 157237e3ef
commit 38c50c2fec
2 changed files with 4 additions and 4 deletions

View File

@ -204,10 +204,10 @@ class ServerAPI{
} }
public function __destruct(){ public function __destruct(){
foreach($this->apiList as $ob){ foreach($this->apiList as $i => $ob){
if(is_callable($ob, "__destruct")){ if(method_exists($ob, "__destruct")){
$ob->__destruct(); $ob->__destruct();
unset($this->apiList[$ob]); unset($this->apiList[$i]);
} }
} }
} }

View File

@ -128,7 +128,7 @@ class Level{
public function __destruct(){ public function __destruct(){
if(isset($this->level)){ if(isset($this->level)){
$this->save(); $this->save(false, false);
$this->level->close(); $this->level->close();
unset($this->level); unset($this->level);
} }