From b08f93c1db31680572847c7b8d167e38919dbea1 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 6 Jun 2007 18:36:11 +0000 Subject: [PATCH] Add a free() function on SearchResultSet class, so the underlying result set can be freed --- includes/SearchEngine.php | 8 ++++++++ includes/SearchMySQL.php | 4 ++++ includes/SpecialSearch.php | 2 ++ 3 files changed, 14 insertions(+) diff --git a/includes/SearchEngine.php b/includes/SearchEngine.php index 005d8584af..ca7f15db57 100644 --- a/includes/SearchEngine.php +++ b/includes/SearchEngine.php @@ -322,6 +322,14 @@ class SearchResultSet { function next() { return false; } + + /** + * Frees the result set, if applicable. + * @ access public + */ + function free() { + // ... + } } diff --git a/includes/SearchMySQL.php b/includes/SearchMySQL.php index 0e02a6845d..f7d3bfbf15 100644 --- a/includes/SearchMySQL.php +++ b/includes/SearchMySQL.php @@ -200,6 +200,10 @@ class MySQLSearchResultSet extends SearchResultSet { return new SearchResult( $row ); } } + + function free() { + $this->mResultSet->free(); + } } ?> diff --git a/includes/SpecialSearch.php b/includes/SpecialSearch.php index 4e6746936c..3fd0feb748 100644 --- a/includes/SpecialSearch.php +++ b/includes/SpecialSearch.php @@ -185,6 +185,7 @@ class SpecialSearch { } else { $wgOut->addWikiText( '==' . wfMsg( 'notitlematches' ) . "==\n" ); } + $titleMatches->free(); } if( $textMatches ) { @@ -195,6 +196,7 @@ class SpecialSearch { # Don't show the 'no text matches' if we received title matches $wgOut->addWikiText( '==' . wfMsg( 'notextmatches' ) . "==\n" ); } + $textMatches->free(); } if ( $num == 0 ) { -- 2.20.1