From: Brion Vibber Date: Wed, 6 Jun 2007 18:36:11 +0000 (+0000) Subject: Add a free() function on SearchResultSet class, so the underlying result set can... X-Git-Tag: 1.31.0-rc.0~52637 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=b08f93c1db31680572847c7b8d167e38919dbea1;p=lhc%2Fweb%2Fwiklou.git Add a free() function on SearchResultSet class, so the underlying result set can be freed --- 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 ) {