diff --git a/Source/Modules/lua.cxx b/Source/Modules/lua.cxx index 0a7dd1041..413c30b32 100644 --- a/Source/Modules/lua.cxx +++ b/Source/Modules/lua.cxx @@ -1321,12 +1321,14 @@ public: assert(class_fq_symname != 0); mangled_class_fq_symname = Swig_name_mangle(class_fq_symname); - PtrGuard t = Copy(Getattr(n, "name")); - PtrGuard fr_t = SwigType_typedef_resolve_all(t); /* Create fully resolved type */ - PtrGuard t_tmp = SwigType_typedef_qualified(fr_t); // Temporal variable + PtrGuard t( Copy(Getattr(n, "name")) ); + PtrGuard fr_t( SwigType_typedef_resolve_all(t) ); /* Create fully resolved type */ + PtrGuard t_tmp; + t_tmp = SwigType_typedef_qualified(fr_t); // Temporal variable fr_t = 0; fr_t = SwigType_strip_qualifiers(t_tmp); - PtrGuard mangled_fr_t = SwigType_manglestr(fr_t); + PtrGuard mangled_fr_t; + mangled_fr_t = SwigType_manglestr(fr_t); //Printf( stdout, "Mangled class symname %s fr type%s\n", mangled_class_fq_symname, mangled_fr_t ); // TODO: REMOVE // not sure exactly how this works, // but tcl has a static hashtable of all classes emitted and then only emits code for them once. @@ -1671,15 +1673,18 @@ public: //String *symname = Getattr(n, "sym:name"); int result = Language::staticmemberfunctionHandler(n); - if (cparse_cplusplus && getCurrentClass()) { - Swig_restore(n); // TODO: WTF ? - } current[STATIC_FUNC] = false;; if (result != SWIG_OK) return result; if(v2_compatibility) { + Swig_require("lua_staticmemberfunctionHandler", n, "*lua:name", NIL); + String *target_name = Getattr(n, "lua:name"); + PtrGuard compat_name; + compat_name = Swig_name_member(0, class_symname, target_name); + Setattr(n, "lua:name", compat_name); registerMethod( class_parent_nspace, n ); + Swig_restore(n); } if (Getattr(n, "sym:nextSibling"))