From ca5753bc39e722f066fe0934c97ab02ce4d78213 Mon Sep 17 00:00:00 2001 From: phpnut Date: Thu, 23 Nov 2006 20:23:43 +0000 Subject: [PATCH] Adding fix for Ticket #1683 This frees memory returned from a result set. git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3943 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/datasources/dbo/dbo_mysql.php | 1 + cake/libs/model/datasources/dbo/dbo_mysqli.php | 1 + 2 files changed, 2 insertions(+) diff --git a/cake/libs/model/datasources/dbo/dbo_mysql.php b/cake/libs/model/datasources/dbo/dbo_mysql.php index 82beeced7..cca58a4bb 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysql.php +++ b/cake/libs/model/datasources/dbo/dbo_mysql.php @@ -116,6 +116,7 @@ class DboMysql extends DboSource { * @return boolean True if the database could be disconnected, else false */ function disconnect() { + @mysql_free_result($this->results); $this->connected = !@mysql_close($this->connection); return !$this->connected; } diff --git a/cake/libs/model/datasources/dbo/dbo_mysqli.php b/cake/libs/model/datasources/dbo/dbo_mysqli.php index 8bbac1125..dc49f70f7 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysqli.php +++ b/cake/libs/model/datasources/dbo/dbo_mysqli.php @@ -110,6 +110,7 @@ class DboMysqli extends DboSource { * @return boolean True if the database could be disconnected, else false */ function disconnect() { + @mysqli_free_result($this->results); $this->connected = !@mysqli_close($this->connection); return !$this->connected; }