[pypy-svn] r50374 - pypy/branch/applevel-ctypes2/pypy/module/_ffi/test
cfbolz at codespeak.net
cfbolz at codespeak.net
Sun Jan 6 14:48:42 CET 2008
Author: cfbolz
Date: Sun Jan 6 14:48:42 2008
New Revision: 50374
Modified:
pypy/branch/applevel-ctypes2/pypy/module/_ffi/test/test__ffi.py
Log:
free all memory
Modified: pypy/branch/applevel-ctypes2/pypy/module/_ffi/test/test__ffi.py
==============================================================================
--- pypy/branch/applevel-ctypes2/pypy/module/_ffi/test/test__ffi.py (original)
+++ pypy/branch/applevel-ctypes2/pypy/module/_ffi/test/test__ffi.py Sun Jan 6 14:48:42 2008
@@ -46,6 +46,12 @@
x2->x2 = 3;
return x1;
}
+
+ void free_double_struct(struct x* x1)
+ {
+ free(x1->next);
+ free(x1);
+ }
const char *static_str = "xxxxxx";
@@ -221,11 +227,12 @@
assert X(x.next).x3 == 'x'
x.free()
next.free()
- # XXX isn't that leaking memory?
create_double_struct = lib.ptr("create_double_struct", [], 'P')
x = create_double_struct()
x = X(x)
assert X(x.next).x2 == 3
+ free_double_struct = lib.ptr("free_double_struct", ['P'], None)
+ free_double_struct(x)
def test_array(self):
More information about the pypy-svn
mailing list