[pypy-svn] pypy default: Correctly free CallbackPtr instances, which fixes the failing test in test_tracker.py

amauryfa commits-noreply at bitbucket.org
Mon Mar 7 13:47:26 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: 
Changeset: r42458:30ab46b50ed2
Date: 2011-03-07 13:33 +0100
http://bitbucket.org/pypy/pypy/changeset/30ab46b50ed2/

Log:	Correctly free CallbackPtr instances, which fixes the failing test
	in test_tracker.py

diff --git a/pypy/module/_rawffi/test/test__rawffi.py b/pypy/module/_rawffi/test/test__rawffi.py
--- a/pypy/module/_rawffi/test/test__rawffi.py
+++ b/pypy/module/_rawffi/test/test__rawffi.py
@@ -611,7 +611,7 @@
         a3.free()
         a4.free()
         ll_to_sort.free()
-        del cb
+        cb.free()
 
     def test_another_callback(self):
         import _rawffi
@@ -625,7 +625,7 @@
         res = runcallback(a1)
         assert res[0] == 1<<42
         a1.free()
-        del cb
+        cb.free()
 
     def test_void_returning_callback(self):
         import _rawffi
@@ -641,7 +641,7 @@
         assert res is None
         assert called == [True]
         a1.free()
-        del cb
+        cb.free()
 
     def test_another_callback_in_stackless(self):
         try:
@@ -668,7 +668,7 @@
         res = runcallback(a1)
         assert res[0] == 1<<42
         a1.free()
-        del cb
+        cb.free()
 
     def test_raising_callback(self):
         import _rawffi, sys
@@ -686,7 +686,7 @@
             a1 = cb.byptr()
             res = runcallback(a1)
             a1.free()
-            del cb
+            cb.free()
             val = err.getvalue()
             assert 'ZeroDivisionError' in val
             assert 'callback' in val
@@ -970,6 +970,7 @@
         res = op_x_y(x_y, a1)
         a1.free()
         x_y.free()
+        cb.free()
 
         assert res[0] == 420
 


More information about the Pypy-commit mailing list