check/fix the %delobject feature for member methods
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8604 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
3f696c5300
commit
d731d23397
2 changed files with 13 additions and 8 deletions
|
|
@ -116,7 +116,7 @@ protected:
|
||||||
~G() { }
|
~G() { }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void destroy() { delete this; }
|
static void destroy(G *g) { delete g; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class GG : public G {
|
class GG : public G {
|
||||||
|
|
|
||||||
|
|
@ -943,20 +943,25 @@ int Language::cDeclaration(Node *n) {
|
||||||
|
|
||||||
int
|
int
|
||||||
Language::functionHandler(Node *n) {
|
Language::functionHandler(Node *n) {
|
||||||
Parm *p;
|
String *storage = Getattr(n,"storage");
|
||||||
p = Getattr(n,"parms");
|
int isfriend = CurrentClass && Cmp(storage,"friend") == 0;
|
||||||
|
int isstatic = CurrentClass && Cmp(storage,"static") == 0 &&
|
||||||
|
!(SmartPointer && Getattr(n,"allocate:smartpointeraccess"));
|
||||||
|
Parm *p= Getattr(n,"parms");
|
||||||
if (GetFlag(n,"feature:del")) {
|
if (GetFlag(n,"feature:del")) {
|
||||||
/* the method acts like a delete operator, ie, we need to disown the parameter */
|
/* the method acts like a delete operator, ie, we need to disown the parameter */
|
||||||
if (p) Setattr(p,"wrap:disown","1");
|
if (CurrentClass && !isstatic && !isfriend) {
|
||||||
|
SetFlag(n,"feature:self:disown");
|
||||||
|
} else {
|
||||||
|
if (p) SetFlag(p,"wrap:disown");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!CurrentClass) {
|
if (!CurrentClass) {
|
||||||
globalfunctionHandler(n);
|
globalfunctionHandler(n);
|
||||||
} else {
|
} else {
|
||||||
String *storage = Getattr(n,"storage");
|
if (isstatic) {
|
||||||
if (Cmp(storage,"static") == 0 &&
|
|
||||||
!(SmartPointer && Getattr(n,"allocate:smartpointeraccess"))) {
|
|
||||||
staticmemberfunctionHandler(n);
|
staticmemberfunctionHandler(n);
|
||||||
} else if (Cmp(storage,"friend") == 0) {
|
} else if (isfriend) {
|
||||||
globalfunctionHandler(n);
|
globalfunctionHandler(n);
|
||||||
} else {
|
} else {
|
||||||
memberfunctionHandler(n);
|
memberfunctionHandler(n);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue