[pypy-svn] r72614 - pypy/branch/cpython-extension/pypy/module/cpyext
xoraxax at codespeak.net
xoraxax at codespeak.net
Tue Mar 23 11:53:59 CET 2010
Author: xoraxax
Date: Tue Mar 23 11:53:58 2010
New Revision: 72614
Modified:
pypy/branch/cpython-extension/pypy/module/cpyext/api.py
Log:
Only borrow the type references that we set into the type field.
Modified: pypy/branch/cpython-extension/pypy/module/cpyext/api.py
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/api.py (original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/api.py Tue Mar 23 11:53:58 2010
@@ -138,7 +138,7 @@
if space.is_w(w_type, w_obj):
pto = py_obj
else:
- pto = make_ref(space, w_type)
+ pto = make_ref(space, w_type, borrowed=True)
elif isinstance(w_obj, W_PyCObject):
w_type = space.type(w_obj)
assert isinstance(w_type, W_PyCTypeObject)
@@ -148,7 +148,7 @@
py_obj = lltype.malloc(T, None, flavor="raw")
else:
py_obj = lltype.malloc(PyObject.TO, None, flavor="raw")
- pto = make_ref(space, space.type(w_obj))
+ pto = make_ref(space, space.type(w_obj), borrowed=True)
py_obj.c_obj_type = rffi.cast(PyObject, pto)
py_obj.c_obj_refcnt = 1
ctypes_obj = ll2ctypes.lltype2ctypes(py_obj)
More information about the Pypy-commit
mailing list