Merge branch 'tamuratak-master'
* tamuratak-master: Revert introduction of minor memory leak in Ruby wrappers ruby: use nodeType attribute to determine whether functions are constructors. get return type each time.
This commit is contained in:
commit
70f5a9ceed
1 changed files with 6 additions and 5 deletions
|
|
@ -2122,13 +2122,11 @@ public:
|
||||||
// Generate prototype list, go to first node
|
// Generate prototype list, go to first node
|
||||||
Node *sibl = n;
|
Node *sibl = n;
|
||||||
|
|
||||||
String* type = SwigType_str(Getattr(sibl,"type"),NULL);
|
|
||||||
|
|
||||||
while (Getattr(sibl, "sym:previousSibling"))
|
while (Getattr(sibl, "sym:previousSibling"))
|
||||||
sibl = Getattr(sibl, "sym:previousSibling"); // go all the way up
|
sibl = Getattr(sibl, "sym:previousSibling"); // go all the way up
|
||||||
|
|
||||||
// Constructors will be treated specially
|
// Constructors will be treated specially
|
||||||
const bool isCtor = Cmp(Getattr(sibl,"feature:new"), "1") == 0;
|
const bool isCtor = (!Cmp(Getattr(sibl, "nodeType"), "constructor"));
|
||||||
const bool isMethod = ( Cmp(Getattr(sibl, "ismember"), "1") == 0 &&
|
const bool isMethod = ( Cmp(Getattr(sibl, "ismember"), "1") == 0 &&
|
||||||
(!isCtor) );
|
(!isCtor) );
|
||||||
|
|
||||||
|
|
@ -2150,7 +2148,11 @@ public:
|
||||||
String *protoTypes = NewString("");
|
String *protoTypes = NewString("");
|
||||||
do {
|
do {
|
||||||
Append( protoTypes, "\n\" ");
|
Append( protoTypes, "\n\" ");
|
||||||
if ( !isCtor ) Printv( protoTypes, type, " ", NIL );
|
if (!isCtor) {
|
||||||
|
SwigType *type = SwigType_str(Getattr(sibl, "type"), NULL);
|
||||||
|
Printv(protoTypes, type, " ", NIL);
|
||||||
|
Delete(type);
|
||||||
|
}
|
||||||
Printv(protoTypes, methodName, NIL );
|
Printv(protoTypes, methodName, NIL );
|
||||||
Parm* p = Getattr(sibl, "wrap:parms");
|
Parm* p = Getattr(sibl, "wrap:parms");
|
||||||
if (p && (current == MEMBER_FUNC || current == MEMBER_VAR ||
|
if (p && (current == MEMBER_FUNC || current == MEMBER_VAR ||
|
||||||
|
|
@ -2171,7 +2173,6 @@ public:
|
||||||
Append(f->code, "\nreturn Qnil;\n");
|
Append(f->code, "\nreturn Qnil;\n");
|
||||||
|
|
||||||
Delete(methodName);
|
Delete(methodName);
|
||||||
Delete(type);
|
|
||||||
Delete(protoTypes);
|
Delete(protoTypes);
|
||||||
|
|
||||||
Printv(f->code, "}\n", NIL);
|
Printv(f->code, "}\n", NIL);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue