diff options
author | emkael <emkael@tlen.pl> | 2019-07-17 22:46:12 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2019-07-17 22:46:12 +0200 |
commit | 7066a2d1436cf6a3261fcfc114eba23f4337407d (patch) | |
tree | 389f0a38dd7b84d1eaf2eb0cc1622b6ddc086976 | |
parent | 6a7c6d59fd21872c5a59ce3aada4bf8bc2c4c6c2 (diff) |
Possible fix for .so segfaults
-rw-r--r-- | bcdd/BCalcWrapper.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bcdd/BCalcWrapper.py b/bcdd/BCalcWrapper.py index 9337809..d7ed7cd 100644 --- a/bcdd/BCalcWrapper.py +++ b/bcdd/BCalcWrapper.py @@ -2,7 +2,7 @@ Wrapper class for libbcalcDDS.dll ''' -from ctypes import cdll +from ctypes import cdll, c_void_p from .Exceptions import DllNotFoundException @@ -25,7 +25,12 @@ class BCalcWrapper(object): def __getattr__(self, attrname): def _dynamic_method(*args): - return getattr(self.libbcalcdds, 'bcalcDDS_' + attrname)(*args) + function = getattr(self.libbcalcdds, 'bcalcDDS_' + attrname) + if attrname == 'new': + function.restype = c_void_p + else: + function.argtypes = [c_void_p] + return function(*args) return _dynamic_method def declarerToLeader(self, player): |