[pypy-svn] pypy jitypes2: fix a memory leak
antocuni
commits-noreply at bitbucket.org
Fri Jan 7 10:03:34 CET 2011
Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: jitypes2
Changeset: r40436:2a072ecaf473
Date: 2011-01-07 10:03 +0100
http://bitbucket.org/pypy/pypy/changeset/2a072ecaf473/
Log: fix a memory leak
diff --git a/lib_pypy/_ctypes/function.py b/lib_pypy/_ctypes/function.py
--- a/lib_pypy/_ctypes/function.py
+++ b/lib_pypy/_ctypes/function.py
@@ -446,7 +446,7 @@
if self._is_struct_shape(shape):
buf = shape[0].fromaddress(result)
else:
- buf = _rawffi.Array(shape)(1)
+ buf = _rawffi.Array(shape)(1, autofree=True)
buf[0] = result
retval = restype._CData_retval(buf)
return retval
More information about the Pypy-commit
mailing list