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