diff --git a/Lib/swigrun.swg b/Lib/swigrun.swg index a52b9b4a1..c80350af3 100644 --- a/Lib/swigrun.swg +++ b/Lib/swigrun.swg @@ -67,6 +67,7 @@ typedef struct swig_type_info { swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ struct swig_cast_info *cast; /* linked list of types that can cast into this type */ void *clientdata; /* language specific type data */ + int owndata; /* flag if the structure owns the clientdata */ } swig_type_info; /* Structure to store a type and conversion function used for casting */ @@ -253,7 +254,12 @@ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { cast = cast->next; } } - +SWIGRUNTIME void +SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { + SWIG_TypeClientData(ti, clientdata); + ti->owndata = 1; +} + /* Search for a swig_type_info structure only by mangled name Search is a O(log #types) diff --git a/Source/Swig/typesys.c b/Source/Swig/typesys.c index 757ba5c0b..f61e89272 100644 --- a/Source/Swig/typesys.c +++ b/Source/Swig/typesys.c @@ -1875,7 +1875,7 @@ SwigType_emit_type_table(File *f_forward, File *f_table) { } else { nt = NewStringf("%s|%s", rn, ln); } - Printf(types, "\"%s\", \"%s\", 0, 0, %s};\n", ki.item, nt, cd); + Printf(types, "\"%s\", \"%s\", 0, 0, %s, 0};\n", ki.item, nt, cd); el = SwigType_equivalent_mangle(ki.item,0,0); for (ei = First(el); ei.item; ei = Next(ei)) { @@ -1891,7 +1891,7 @@ SwigType_emit_type_table(File *f_forward, File *f_table) { Delete(ckey); if (!Getattr(r_mangled, ei.item) && !Getattr(imported_types, ei.item)) { - Printf(types, "static swig_type_info _swigt_%s = {\"%s\", 0, 0, 0, 0};\n", ei.item, ei.item); + Printf(types, "static swig_type_info _swigt_%s = {\"%s\", 0, 0, 0, 0, 0};\n", ei.item, ei.item); Append(table_list, ei.item); Printf(cast, "static swig_cast_info _swigc_%s[] = {{&_swigt_%s, 0, 0, 0},{0, 0, 0, 0}};\n",