I noticed this with StopFilter: there seems to be a missing
DeleteLocalRef in JArray's specialization for strings.  I'm attaching
a test case and a patch.  (The other specializations all look OK, since
they're scalar types not requiring allocation.)

   Aaron Lav ([EMAIL PROTECTED])


import lucene

if __name__ == '__main__':
    env = lucene.initVM(classpath=lucene.CLASSPATH)
    stop_set = ['the', 'and', 's']
    reader = lucene.StringReader('foo')
    while 1:
        result = lucene.StandardTokenizer(reader)
        result = lucene.StopFilter(result, stop_set)

Index: jcc/sources/JArray.h
===================================================================
--- jcc/sources/JArray.h        (revision 475)
+++ jcc/sources/JArray.h        (working copy)
@@ -267,6 +267,7 @@
                 break;
 
             env->setObjectArrayElement((jobjectArray) this$, i, str);
+            env->get_vm_env()->DeleteLocalRef(str);
         }
     }
 
_______________________________________________
pylucene-dev mailing list
pylucene-dev@osafoundation.org
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

Reply via email to