[pypy-commit] pypy default: Untested: fix the __del__ in module/oracle too.

arigo noreply at buildbot.pypy.org
Wed Aug 17 17:04:38 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r46561:bd2699d3f1ad
Date: 2011-08-17 17:08 +0200
http://bitbucket.org/pypy/pypy/changeset/bd2699d3f1ad/

Log:	Untested: fix the __del__ in module/oracle too.

diff --git a/pypy/module/oracle/interp_connect.py b/pypy/module/oracle/interp_connect.py
--- a/pypy/module/oracle/interp_connect.py
+++ b/pypy/module/oracle/interp_connect.py
@@ -82,6 +82,11 @@
         return space.wrap(self)
 
     def __del__(self):
+        self.enqueue_for_destruction(self.space, W_Connection.destructor,
+                                     '__del__ method of ')
+
+    def destructor(self):
+        assert isinstance(self, W_Connection)
         if self.release:
             roci.OCITransRollback(
                 self.handle, self.environment.errorHandle,
diff --git a/pypy/module/oracle/interp_object.py b/pypy/module/oracle/interp_object.py
--- a/pypy/module/oracle/interp_object.py
+++ b/pypy/module/oracle/interp_object.py
@@ -16,6 +16,11 @@
         self.initialize(connection, param)
 
     def __del__(self):
+        self.enqueue_for_destruction(self.space, W_ObjectType.destructor,
+                                     '__del__ method of ')
+
+    def destructor(self):
+        assert isinstance(self, W_ObjectType)
         if self.tdo:
             roci.OCIObjectUnpin(
                 self.environment.handle,
diff --git a/pypy/module/oracle/interp_variable.py b/pypy/module/oracle/interp_variable.py
--- a/pypy/module/oracle/interp_variable.py
+++ b/pypy/module/oracle/interp_variable.py
@@ -167,6 +167,11 @@
         self.initialize(self.environment.space, cursor)
 
     def __del__(self):
+        self.enqueue_for_destruction(self.space, W_Variable.destructor,
+                                     '__del__ method of ')
+
+    def destructor(self):
+        assert isinstance(self, W_Variable)
         self.finalize()
         lltype.free(self.actualElementsPtr, flavor='raw')
         if self.actualLength:


More information about the pypy-commit mailing list