[pypy-svn] r73317 - pypy/branch/cpython-extension/pypy/module/cpyext

fijal at codespeak.net fijal at codespeak.net
Sat Apr 3 01:52:33 CEST 2010


Author: fijal
Date: Sat Apr  3 01:52:32 2010
New Revision: 73317

Modified:
   pypy/branch/cpython-extension/pypy/module/cpyext/stringobject.py
Log:
decref the old string


Modified: pypy/branch/cpython-extension/pypy/module/cpyext/stringobject.py
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/stringobject.py	(original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/stringobject.py	Sat Apr  3 01:52:32 2010
@@ -3,7 +3,7 @@
                                     PyStringObject, Py_ssize_t, cpython_struct,
                                     CANNOT_FAIL, build_type_checkers,
                                     PyObjectP, cpython_api_c)
-from pypy.module.cpyext.pyobject import PyObject, make_ref, from_ref
+from pypy.module.cpyext.pyobject import PyObject, make_ref, from_ref, Py_DecRef
 
 
 PyString_Check, PyString_CheckExact = build_type_checkers("String", "w_str")
@@ -71,5 +71,6 @@
     # XXX always create a new string so fa
     w_s = from_ref(space, ref[0])
     ptr = make_ref(space, space.wrap(space.str_w(w_s)[:newsize]))
+    Py_DecRef(space, ref[0])
     ref[0] = ptr
     return 0



More information about the Pypy-commit mailing list