Open Borfonius opened 4 months ago
The change seems to be baf422e69e100f3b409a0e1a5c5bfd27b46dfdab, so this is probably a regression introduced in 4.2.1. @wsfulton That was one of yours
Seems to referring to this comment and code:
@Borfonius , I think you have a better understanding of SWIG and multiple modules. I am not particularly familiar with Tcl, so will need some suggestions for detecting when deleteProc in Tcl_CmdInfo contains a SWIG object in the case of multiple modules. I don't know how to replicate your multiple modules problem, so a small cutdown example would help and more so if someone could debug what happens in such a case.
Recently, an additional check was added to the SWIG_Tcl_ConvertPtrFromString function. This check compares the TclCommandInfo "deleteProc" attribute to make sure it is set to the SWIG_TclObjectDelete function. This is problematic when there are multiple modules in a wrapped API. This happens when the base class of a called method is not defined in the same module where the subclass constructor is defined. This is because each module gets its own locally scoped SWIG_TclObjectDelete function, and this function is not visible to other modules. So the code that does the following comparison:
if (info.deleteProc == SWIG_Tcl_ObjectDelete) {
Will fail, even though the referenced object is indeed a SWIG wrapped object.