Fix: ExecutionEngine should own TargetData instance returned from ee.target_data

This commit is contained in:
Siu Kwan Lam 2013-01-18 10:00:44 -06:00
commit 6bc5b72c71
2 changed files with 5 additions and 2 deletions

View file

@ -366,7 +366,9 @@ class TargetMachine(llvm.Ownable):
'''get target data of this machine
'''
ptr = _core.LLVMTargetMachineGetTargetData(self.ptr)
return TargetData(ptr)
td = TargetData(ptr)
td._own(self)
return td
@property
def target_name(self):