Add a free() function on SearchResultSet class, so the underlying result set can...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 6 Jun 2007 18:36:11 +0000 (18:36 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 6 Jun 2007 18:36:11 +0000 (18:36 +0000)
includes/SearchEngine.php
includes/SearchMySQL.php
includes/SpecialSearch.php

index 005d858..ca7f15d 100644 (file)
@@ -322,6 +322,14 @@ class SearchResultSet {
        function next() {
                return false;
        }
+       
+       /**
+        * Frees the result set, if applicable.
+        * @ access public
+        */
+       function free() {
+               // ...
+       }
 }
 
 
index 0e02a68..f7d3bfb 100644 (file)
@@ -200,6 +200,10 @@ class MySQLSearchResultSet extends SearchResultSet {
                        return new SearchResult( $row );
                }
        }
+       
+       function free() {
+               $this->mResultSet->free();
+       }
 }
 
 ?>
index 4e67469..3fd0feb 100644 (file)
@@ -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 ) {