ArchiveOrangemail archive

commits.lucene.apache.org


(List home) (Recent threads) (34 other Apache Lucene lists)

Subscription Options

  • RSS or Atom: Read-only subscription using a browser or aggregator. This is the recommended way if you don't need to send messages to the list. You can learn more about feed syndication and clients here.
  • Conventional: All messages are delivered to your mail address, and you can reply. To subscribe, send an email to the list's subscribe (we seem to have lost it) address with "subscribe" in the subject line, or visit the list's homepage here.
  • This list contains about 368 messages, beginning Feb 2005
  • This list doesn't seem to be active
Report the Spam
This button sends a spam report to the moderator. Please use it sparingly. For other removal requests, read this.
Are you sure? yes no

svn commit: r800403 - in /lucene/pylucene/trunk/jcc: CHANGES jcc/cpp.py jcc/sources/JArray.h

Ad
vajda1249309694Mon, 03 Aug 2009 14:28:14 +0000 (UTC)
Author: vajda
Date: Mon Aug  3 14:27:56 2009
New Revision: 800403

URL: http://svn.apache.org/viewvc?rev=800403&v...
Log:
fixed local string ref leaks in JArray<jstring>.get/toSequence (Aric Coady)

Modified:
    lucene/pylucene/trunk/jcc/CHANGES
    lucene/pylucene/trunk/jcc/jcc/cpp.py
    lucene/pylucene/trunk/jcc/jcc/sources/JArray.h

Modified: lucene/pylucene/trunk/jcc/CHANGES
URL: http://svn.apache.org/viewvc/lucene/pylucene/...
==============================================================================
--- lucene/pylucene/trunk/jcc/CHANGES (original)
+++ lucene/pylucene/trunk/jcc/CHANGES Mon Aug  3 14:27:56 2009
@@ -3,6 +3,7 @@
 ------------------
  - added 'typeof' to reserved word list
  - added Java stacktrace to __str__() of JavaError, fixing half of PYLUCENE-1
+ - fixed local string ref leaks in JArray<jstring>.get/toSequence (Aric Coady)
  -  Version 2.2 -> 2.3

Modified: lucene/pylucene/trunk/jcc/jcc/cpp.py
URL: http://svn.apache.org/viewvc/lucene/pylucene/...
==============================================================================
--- lucene/pylucene/trunk/jcc/jcc/cpp.py (original)
+++ lucene/pylucene/trunk/jcc/jcc/cpp.py Mon Aug  3 14:27:56 2009
@@ -48,11 +48,9 @@
 class JavaError(Exception):     def getJavaException(self):
-
         return self.args[0]     def __str__(self):
-
         writer = StringWriter()
         self.getJavaException().printStackTrace(PrintWriter(writer))
Modified: lucene/pylucene/trunk/jcc/jcc/sources/JArray.h
URL: http://svn.apache.org/viewvc/lucene/pylucene/...
==============================================================================
--- lucene/pylucene/trunk/jcc/jcc/sources/JArray.h (original)
+++ lucene/pylucene/trunk/jcc/jcc/sources/JArray.h Mon Aug  3 14:27:56 2009
@@ -292,10 +292,11 @@
         PyObject *list = PyList_New(hi - lo);         for (int i = lo; i < hi; i++) {
-            jstring value = (jstring)
+            jstring str = (jstring)
                 env->getObjectArrayElement((jobjectArray) this$, i);
-            PyObject *obj = env->fromJString(value);
+            PyObject *obj = env->fromJString(str);+            env->get_vm_env()->DeleteLocalRef(str);
             PyList_SET_ITEM(list, i - lo, obj);
         }
          
@@ -313,8 +314,10 @@
             {
                 jstring str = (jstring)
                     env->getObjectArrayElement((jobjectArray) this$, n);
+                PyObject *obj = env->fromJString(str);-                return env->fromJString(str);
+                env->get_vm_env()->DeleteLocalRef(str);
+                return obj;
             }
         }
Home | About | Privacy