#286 [ruby] Fix overwrite of SwigClass vars with multiple modules

closed-accepted
None
5
2011-11-13
2011-10-11
No

This is a patch for bug 3416818. I originally attached the patch there, but then noticed that there's a separate tracker for patches, so here it is.

In a nutshell: The SwigClass* variables were declared globally on the file level. When a wrapped class had the same name as another class from a different module (but e.g. a different namespace), they would overwrite each other's .klass and other fields. By making these variables static, they are restricted to the file, which solves the problem. See bug 3416818 for a running example.

Another solution would be to declare it in the Init function (which seems to have been the case in the past, but was changed in r6944).

Discussion

  • William Fulton

    William Fulton - 2011-11-13
    • assigned_to: nobody --> wsfulton
    • status: open --> closed-accepted
     
  • William Fulton

    William Fulton - 2011-11-13

    Thanks, applied for swig-2.0.5.

     

Log in to post a comment.