From 38c50c2fecc726fffaf51eec98267e316bf92f33 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Sat, 8 Jun 2013 01:40:13 +0200 Subject: [PATCH] Fixed API unloading --- src/API/ServerAPI.php | 6 +++--- src/world/Level.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/API/ServerAPI.php b/src/API/ServerAPI.php index 0053ba6f55..21e08e9f73 100644 --- a/src/API/ServerAPI.php +++ b/src/API/ServerAPI.php @@ -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]); } } } diff --git a/src/world/Level.php b/src/world/Level.php index 40b8086c8a..4e383a6ec1 100644 --- a/src/world/Level.php +++ b/src/world/Level.php @@ -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); }