From 316945a6339230a7dc1db130261686c8c8ebf555 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 24 Sep 2005 03:44:54 +0000 Subject: [PATCH] * (bug 3182) Clear link cache during import to prevent memory leak --- RELEASE-NOTES | 1 + includes/SpecialImport.php | 4 ++++ maintenance/importDump.php | 1 + 3 files changed, 6 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 72bc19d27b..c59eddb2d7 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -118,6 +118,7 @@ fully support the editing toolbar, but was found to be too confusing. by default when 'watchdefault' option is on * Skip update of disused 'rc_cur_time' field (todo: discard the field) * (bug 3506) Avoid MySQL error when Listusers returns no results +* (bug 3182) Clear link cache during import to prevent memory leak === Caveats === diff --git a/includes/SpecialImport.php b/includes/SpecialImport.php index 5a7db20180..c36b48bb70 100644 --- a/includes/SpecialImport.php +++ b/includes/SpecialImport.php @@ -197,6 +197,10 @@ class WikiRevision { $userText = $this->getUser(); } + // avoid memory leak...? + global $wgLinkCache; + $wgLinkCache->clear(); + $article = new Article( $this->title ); $pageId = $article->getId(); if( $pageId == 0 ) { diff --git a/maintenance/importDump.php b/maintenance/importDump.php index 15110ffd21..3a58550c6b 100644 --- a/maintenance/importDump.php +++ b/maintenance/importDump.php @@ -45,6 +45,7 @@ class BackupReader { function handleRevision( $rev ) { $title = $rev->getTitle(); if (!$title) { + $this->progress( "Got bogus revision with null title!" ); return; } $display = $title->getPrefixedText(); -- 2.20.1