From 5bdf42a92568d2f3c581918cc6264257a0e99b44 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20M=C3=BCller?= <thomas.mueller@tmit.eu>
Date: Mon, 23 Feb 2015 17:17:20 +0100
Subject: [PATCH] Close the cursor after the affected count has been extracted.

---
 lib/private/db/statementwrapper.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/private/db/statementwrapper.php b/lib/private/db/statementwrapper.php
index 8d704f0bbe..14b68d60f4 100644
--- a/lib/private/db/statementwrapper.php
+++ b/lib/private/db/statementwrapper.php
@@ -79,8 +79,9 @@ class OC_DB_StatementWrapper {
 			return false;
 		}
 		if ($this->isManipulation) {
+			$count = $this->statement->rowCount();
 			$this->statement->closeCursor();
-			return $this->statement->rowCount();
+			return $count;
 		} else {
 			return $this;
 		}
-- 
GitLab