[llvm-commits] [llvm] r152505 - /llvm/trunk/bindings/python/llvm/common.py

Gregory Szorc gregory.szorc at gmail.com
Sat Mar 10 13:01:14 PST 2012


Author: gps
Date: Sat Mar 10 15:01:14 2012
New Revision: 152505

URL: http://llvm.org/viewvc/llvm-project?rev=152505&view=rev
Log:
[llvm.py] Make LLVMObject.__del__ work if called during __init__

Modified:
    llvm/trunk/bindings/python/llvm/common.py

Modified: llvm/trunk/bindings/python/llvm/common.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/python/llvm/common.py?rev=152505&r1=152504&r2=152505&view=diff
==============================================================================
--- llvm/trunk/bindings/python/llvm/common.py (original)
+++ llvm/trunk/bindings/python/llvm/common.py Sat Mar 10 15:01:14 2012
@@ -58,6 +58,9 @@
         return self._as_parameter_
 
     def __del__(self):
+        if not hasattr(self, '_self_owned') or not hasattr(self, '_disposer'):
+            return
+
         if self._self_owned and self._disposer:
             self._disposer(self)
 





More information about the llvm-commits mailing list