Author: Armin Rigo <[email protected]>
Branch: gc-del
Changeset: r63670:89bcb5d5942a
Date: 2013-04-26 22:46 +0200
http://bitbucket.org/pypy/pypy/changeset/89bcb5d5942a/

Log:    Fixes

diff --git a/pypy/module/_cffi_backend/ccallback.py 
b/pypy/module/_cffi_backend/ccallback.py
--- a/pypy/module/_cffi_backend/ccallback.py
+++ b/pypy/module/_cffi_backend/ccallback.py
@@ -54,12 +54,13 @@
         if rffi.cast(lltype.Signed, res) != clibffi.FFI_OK:
             raise OperationError(space.w_SystemError,
                 space.wrap("libffi failed to build this callback"))
+        #
+        self.register_finalizer()
 
     def get_closure(self):
         return rffi.cast(clibffi.FFI_CLOSUREP, self._cdata)
 
-    #@rgc.must_be_light_finalizer
-    def __del__(self):
+    def invoke_finalizer(self):
         clibffi.closureHeap.free(self.get_closure())
         if self.ll_error:
             lltype.free(self.ll_error, flavor='raw')
diff --git a/pypy/module/_hashlib/interp_hashlib.py 
b/pypy/module/_hashlib/interp_hashlib.py
--- a/pypy/module/_hashlib/interp_hashlib.py
+++ b/pypy/module/_hashlib/interp_hashlib.py
@@ -38,8 +38,9 @@
         except:
             lltype.free(ctx, flavor='raw')
             raise
+        self.register_finalizer()
 
-    def __del__(self):
+    def invoke_finalizer(self):
         if self.ctx:
             ropenssl.EVP_MD_CTX_cleanup(self.ctx)
             lltype.free(self.ctx, flavor='raw')
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to