diff --git a/includes/ForkController.php b/includes/ForkController.php index e5b44c2b501..1cd49e76b54 100644 --- a/includes/ForkController.php +++ b/includes/ForkController.php @@ -115,10 +115,10 @@ class ForkController { } protected function prepareEnvironment() { - global $wgCaches, $wgMemc; + global $wgMemc; // Don't share DB or memcached connections wfGetLBFactory()->destroyInstance(); - $wgCaches = array(); + ObjectCache::clear(); unset( $wgMemc ); } diff --git a/includes/objectcache/ObjectCache.php b/includes/objectcache/ObjectCache.php index 5155c0da9a9..118aadfe27a 100644 --- a/includes/objectcache/ObjectCache.php +++ b/includes/objectcache/ObjectCache.php @@ -21,6 +21,13 @@ class ObjectCache { return $object; } + /** + * Clear all the cached instances. + */ + static function clear() { + self::$instances = array(); + } + /** * Create a new cache object of the specified type. */