Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1283 Directors broken for smart pointer types

None
closed
java (79)
5
2013-01-05
2012-11-15
Brant Kyser
No

Directors do not work for smart pointer types. I have attached a patch that adds a test case that demonstrates this issue.

There seems to be two issues that prevent this from working...

1) The boost shared pointer type maps changes the name of the swigCMemOwn member variable to swigCMemOwnBase, and the director code assumes the presents of the swigCMemOwn variable.

2) If one fixes the variable name from the first issue, a runtime failure occurs due to a dynamic cast failing and the result not being checked for null prior to use. The dynamic cast fails due to the cast assuming the pointer being passed into the function is the type of the director and the type is really a shared pointer to the director type.

Discussion

  • William Fulton
    William Fulton
    2013-01-05

    Applied Brant's patch on Github for swig-2.0.10. Thanks.

     
  • William Fulton
    William Fulton
    2013-01-05

    • status: open --> closed
    • milestone: -->