From 574e2eb0df4bc454e847e1974e04c0d85aa661f7 Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 14 Feb 2011 05:23:16 +0000 Subject: Clearing caches in ElggBatch. git-svn-id: http://code.elgg.org/elgg/trunk@8226 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggBatch.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'engine/classes/ElggBatch.php') diff --git a/engine/classes/ElggBatch.php b/engine/classes/ElggBatch.php index 4f8f6cae9..a5051d16a 100644 --- a/engine/classes/ElggBatch.php +++ b/engine/classes/ElggBatch.php @@ -206,6 +206,13 @@ class ElggBatch * @return bool */ private function getNextResultsChunk() { + // reset memory caches after first chunk load + if ($this->chunkIndex > 0) { + global $DB_QUERY_CACHE, $ENTITY_CACHE; + $DB_QUERY_CACHE = $ENTITY_CACHE = array(); + } + + // always reset results. $this->results = array(); if (!isset($this->validGetter)) { -- cgit v1.2.3