Alon Bar-Lev has uploaded a new change for review.

Change subject: core: transaction: destructor should be at unmanaged object
......................................................................

core: transaction: destructor should be at unmanaged object

The transaction element is a managed object, so there is no need for
random destructor, also the abort is not re-entrant.

The transaction is unmanaged one and abort is re-entrant, and may enjoy
destructor usage for cleanup in case program misbehaves.

Reported-By: Simone Tiraboschi <stira...@redhat.com>
Change-Id: I4dce1bb8d09e2bfda5cc6e76339378c33736d5a4
Signed-off-by: Alon Bar-Lev <alo...@redhat.com>
---
M src/otopi/transaction.py
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/otopi refs/changes/86/42486/1

diff --git a/src/otopi/transaction.py b/src/otopi/transaction.py
index d8ad0bf..b0fc103 100644
--- a/src/otopi/transaction.py
+++ b/src/otopi/transaction.py
@@ -40,10 +40,6 @@
         """Constructor."""
         super(TransactionElement, self).__init__()
 
-    def __del__(self):
-        """Destructor."""
-        self.abort()
-
     def __str__(self):
         """String representation."""
         return self.__name__
@@ -102,6 +98,10 @@
         for element in elements:
             self.append(element)
 
+    def __del__(self):
+        """Destructor."""
+        self.abort()
+
     def __str__(self):
         return 'transaction'
 


-- 
To view, visit https://gerrit.ovirt.org/42486
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4dce1bb8d09e2bfda5cc6e76339378c33736d5a4
Gerrit-PatchSet: 1
Gerrit-Project: otopi
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to