always emit the director destructor, just in case
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6529 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
7afd2f554b
commit
a74a712e03
1 changed files with 15 additions and 5 deletions
|
|
@ -1762,12 +1762,22 @@ int Language::classDirectorInit(Node *n) {
|
|||
* ---------------------------------------------------------------------- */
|
||||
|
||||
int Language::classDirectorDestructor(Node *n) {
|
||||
if (Getattr(n,"throw")) {
|
||||
File *f_directors_h = Swig_filebyname("director_h");
|
||||
String *classname= Swig_class_name(getCurrentClass());
|
||||
Printf(f_directors_h, " virtual ~SwigDirector_%s() throw () {}\n", classname);
|
||||
Delete(classname);
|
||||
/*
|
||||
Always emit the virtual destructor in the declaration and in the
|
||||
compilation unit. Been explicit here can't make any damage, and
|
||||
can solve some nasty C++ compiler problems.
|
||||
*/
|
||||
File *f_directors = Swig_filebyname("director");
|
||||
File *f_directors_h = Swig_filebyname("director_h");
|
||||
String *classname= Swig_class_name(getCurrentClass());
|
||||
if (Getattr(n,"throw")) {
|
||||
Printf(f_directors_h, " virtual ~SwigDirector_%s() throw ();\n", classname);
|
||||
Printf(f_directors, "SwigDirector_%s::~SwigDirector_%s() throw () {}\n", classname, classname);
|
||||
} else {
|
||||
Printf(f_directors_h, " virtual ~SwigDirector_%s();\n", classname);
|
||||
Printf(f_directors, "SwigDirector_%s::~SwigDirector_%s() {}\n", classname, classname);
|
||||
}
|
||||
Delete(classname);
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue