Modified C++ handling code to inherit destructors so that a derived class
without a destructor can pick up a destructor (if any) from a base class. This is highly experimental---I may take it out if it breaks too much stuff. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@777 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6df63cbf3c
commit
2b0da81001
1 changed files with 14 additions and 0 deletions
|
|
@ -352,6 +352,19 @@ public:
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
void inherit(int mode) {
|
||||
// Set up the proper addmethods mode and provide C code (if provided)
|
||||
int oldaddmethods = AddMethods;
|
||||
int oldnewobject = NewObject;
|
||||
AddMethods = new_method;
|
||||
Clear(CCode);
|
||||
Append(CCode,code);
|
||||
cplus_destructor(name,iname);
|
||||
AddMethods = oldaddmethods;
|
||||
Clear(CCode);
|
||||
}
|
||||
|
||||
void emit() {
|
||||
AddMethods = new_method;
|
||||
line_number = line;
|
||||
|
|
@ -1191,6 +1204,7 @@ void cplus_destructor(char *name, char *iname) {
|
|||
|
||||
CPP_destructor *d;
|
||||
|
||||
if (current_class->have_destructor) return;
|
||||
d = new CPP_destructor(name,iname);
|
||||
current_class->add_member(d);
|
||||
current_class->have_destructor = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue