Switch to side-by-side view

--- a/src/rcldb/rclquery_p.h
+++ b/src/rcldb/rclquery_p.h
@@ -1,6 +1,6 @@
 #ifndef _rclquery_p_h_included_
 #define _rclquery_p_h_included_
-/* @(#$Id: rclquery_p.h,v 1.1 2008-06-13 18:22:46 dockes Exp $  (C) 2007 J.F.Dockes */
+/* @(#$Id: rclquery_p.h,v 1.2 2008-07-01 08:31:08 dockes Exp $  (C) 2007 J.F.Dockes */
 
 #include <map>
 #include <vector>
@@ -15,11 +15,15 @@
 
 class Query::Native {
 public:
-    Xapian::Query    query; // query descriptor: terms and subqueries
-			    // joined by operators (or/and etc...)
+    /** The query I belong to */
+    Query                *m_q;
+    /** query descriptor: terms and subqueries joined by operators
+     * (or/and etc...)
+     */
+    Xapian::Query    query; 
 
-    vector<int> m_dbindices; // In case there is a postq filter: sequence of 
-                             // db indices that match
+    /** In case there is a postq filter: sequence of db indices that match */
+    vector<int> m_dbindices; 
 
     // Filtering results on location. There are 2 possible approaches
     // for this:
@@ -39,26 +43,27 @@
     // Which is used is decided in SetQuery(), by setting either of
     // the two following members. This in turn is controlled by a
     // preprocessor directive.
-
 #define XAPIAN_FILTERING 1
-
     Xapian::MatchDecider *decider;   // Xapian does the filtering
     Xapian::MatchDecider *postfilter; // Result filtering done by Recoll
 
     Xapian::Enquire      *enquire; // Open query descriptor.
     Xapian::MSet          mset;    // Partial result set
-    Query *m_q;
     // Term frequencies for current query. See makeAbstract, setQuery
     map<string, double>  termfreqs; 
 
     Native(Query *q)
-	: decider(0), postfilter(0), enquire(0), m_q(q)
+	: m_q(q), decider(0), postfilter(0), enquire(0)
     { }
-
     ~Native() {
-	delete decider;
-	delete postfilter;
-	delete enquire;
+	clear();
+    }
+    void clear() {
+	m_dbindices.clear();
+	delete decider; decider = 0;
+	delete postfilter; postfilter = 0;
+	delete enquire; enquire = 0;
+	termfreqs.clear();
     }
 };