Fix directorin SWIGTYPE typemaps to make a copy as these are used for pass by value.
Closes #434
This commit is contained in:
parent
b062d998e9
commit
98a31ff633
15 changed files with 180 additions and 14 deletions
13
Examples/test-suite/python/director_pass_by_value_runme.py
Normal file
13
Examples/test-suite/python/director_pass_by_value_runme.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import director_pass_by_value
|
||||
|
||||
passByVal = None
|
||||
class director_pass_by_value_Derived(director_pass_by_value.DirectorPassByValueAbstractBase):
|
||||
def virtualMethod(self, b):
|
||||
global passByVal
|
||||
passByVal = b
|
||||
|
||||
# bug was the passByVal global object was destroyed after the call to virtualMethod had finished.
|
||||
director_pass_by_value.Caller().call_virtualMethod(director_pass_by_value_Derived())
|
||||
ret = passByVal.getVal();
|
||||
if ret != 0x12345678:
|
||||
raise RuntimeError("Bad return value, got " + hex(ret))
|
||||
Loading…
Add table
Add a link
Reference in a new issue