added missing mysqli result close calls

This commit is contained in:
Steffen Schröder 2014-03-20 16:19:09 +01:00
parent 415ca788c2
commit 2b69a7aad5

View File

@ -1,6 +1,7 @@
<?php <?php
namespace ManiaControl; namespace ManiaControl;
use ManiaControl\Callbacks\TimerListener; use ManiaControl\Callbacks\TimerListener;
/** /**
@ -60,6 +61,7 @@ class Database implements TimerListener{
/** /**
* Check if Connection still exists every 5 seconds * Check if Connection still exists every 5 seconds
*
* @param $time * @param $time
*/ */
public function checkConnection($time) { public function checkConnection($time) {
@ -132,6 +134,7 @@ class Database implements TimerListener{
} }
$count = $result->num_rows; $count = $result->num_rows;
if ($count <= 0) { if ($count <= 0) {
$result->close();
return true; return true;
} }
$optimizeQuery = "OPTIMIZE TABLE "; $optimizeQuery = "OPTIMIZE TABLE ";
@ -144,6 +147,7 @@ class Database implements TimerListener{
} }
$index++; $index++;
} }
$result->close();
$optimizeQuery .= ";"; $optimizeQuery .= ";";
$this->mysqli->query($optimizeQuery); $this->mysqli->query($optimizeQuery);
if ($this->mysqli->error) { if ($this->mysqli->error) {