From 1560bad60cd31d16acb7bb151c1e807e16d9ca5b Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 22 May 2013 22:38:05 +1200 Subject: [PATCH] Free the result when at the end of a set using mssql drivers --- code/MSSQLDatabase.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/MSSQLDatabase.php b/code/MSSQLDatabase.php index 17b21e6..fb65482 100644 --- a/code/MSSQLDatabase.php +++ b/code/MSSQLDatabase.php @@ -1868,6 +1868,10 @@ class MSSQLQuery extends SS_Query { } } return $data; + } else { + // free the handle, no more results + mssql_free_result($this->handle); + $this->handle = null; } } else { if($data = sqlsrv_fetch_array($this->handle, SQLSRV_FETCH_ASSOC)) {