commit | d3ac784fbb1e3cc31f9d8bd702fcda5a63d3ca8e | [log] [tgz] |
---|---|---|
author | Gregory Szorc <gregory.szorc@gmail.com> | Sat Mar 10 21:01:14 2012 +0000 |
committer | Gregory Szorc <gregory.szorc@gmail.com> | Sat Mar 10 21:01:14 2012 +0000 |
tree | 3ce661aba538633ccd700848315bdb714fe6cb12 | |
parent | 644f191d31d45d2c281dfa2a7bfba955f8928348 [diff] |
[llvm.py] Make LLVMObject.__del__ work if called during __init__ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152505 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/bindings/python/llvm/common.py b/bindings/python/llvm/common.py index 9911e69..0c5fcd0 100644 --- a/bindings/python/llvm/common.py +++ b/bindings/python/llvm/common.py
@@ -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)