[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TextIndexNG/src - normalizer.c:1.1.2.5

Andreas Jung andreas@digicool.com
Mon, 11 Feb 2002 10:25:13 -0500


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TextIndexNG/src
In directory cvs.zope.org:/tmp/cvs-serv19764/src

Modified Files:
      Tag: ajung-textindexng-branch
	normalizer.c 
Log Message:
unicode strings in the constructor caused segfault due to a
refcounter problem


=== Zope/lib/python/Products/PluginIndexes/TextIndexNG/src/normalizer.c 1.1.2.4 => 1.1.2.5 ===
         value = PyTuple_GetItem(item,1);
 
-        if (PyString_Check(key))
+        if (PyString_Check(key))  
             key = PyUnicode_FromEncodedObject(key, self->encoding,"strict");
+        else Py_INCREF(key);
 
-        if (PyString_Check(value))
+        if (PyString_Check(value)) 
             value = PyUnicode_FromEncodedObject(value, self->encoding,"strict");
+        else Py_INCREF(value);
 
         tuple = PyTuple_New(2);
 
@@ -213,8 +215,6 @@
 
         Py_DECREF(tuple);
     }
-
-//    Py_DECREF(table);
 }