Define "classname" in cxx_class_wrapper dtor too

No changes, just a tiny refactoring before the upcoming commit.
This commit is contained in:
Vadim Zeitlin 2021-11-24 02:03:25 +01:00
commit 03c6099ac1

View file

@ -520,11 +520,13 @@ public:
// This is the name used for the class pointers in C wrappers.
scoped_dohptr c_class_ptr = get_c_class_ptr(class_node_);
String* const classname = Getattr(class_node_, "sym:name");
// We need to generate a ctor from the C object pointer, which is required to be able to create objects of this class from pointers created by C wrappers
// and also by any derived classes.
Printv(cxx_wrappers_.f_decls,
"\n",
cindent, "explicit ", Getattr(class_node_, "sym:name"), "(", c_class_ptr.get(), " swig_self, "
cindent, "explicit ", classname, "(", c_class_ptr.get(), " swig_self, "
"bool swig_owns_self = true) : ",
NIL
);