Fixed incorrect outputing of free_* functions
when user had defined a new free function with %freefunc. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9706 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
3dc18ec7ca
commit
8931224836
1 changed files with 8 additions and 5 deletions
|
|
@ -1930,10 +1930,16 @@ public:
|
||||||
* -------------------------------------------------------------------- */
|
* -------------------------------------------------------------------- */
|
||||||
|
|
||||||
virtual int destructorHandler(Node *n) {
|
virtual int destructorHandler(Node *n) {
|
||||||
|
|
||||||
|
/* Do no spit free function if user defined his own for this class */
|
||||||
|
Node *pn = Swig_methodclass(n);
|
||||||
|
String *freefunc = Getattr(pn, "feature:freefunc");
|
||||||
|
if (freefunc) return SWIG_OK;
|
||||||
|
|
||||||
current = DESTRUCTOR;
|
current = DESTRUCTOR;
|
||||||
Language::destructorHandler(n);
|
Language::destructorHandler(n);
|
||||||
|
|
||||||
String *freefunc = NewString("");
|
freefunc = NewString("");
|
||||||
String *freebody = NewString("");
|
String *freebody = NewString("");
|
||||||
String *pname0 = Swig_cparm_name(0, 0);
|
String *pname0 = Swig_cparm_name(0, 0);
|
||||||
|
|
||||||
|
|
@ -1942,7 +1948,6 @@ public:
|
||||||
|
|
||||||
/* Check to see if object tracking is activated for the class
|
/* Check to see if object tracking is activated for the class
|
||||||
that owns this destructor. */
|
that owns this destructor. */
|
||||||
Node *pn = Swig_methodclass(n);
|
|
||||||
if (GetFlag(pn, "feature:trackobjects")) {
|
if (GetFlag(pn, "feature:trackobjects")) {
|
||||||
Printf(freebody, "SWIG_RubyRemoveTracking(%s);\n", pname0);
|
Printf(freebody, "SWIG_RubyRemoveTracking(%s);\n", pname0);
|
||||||
Printv(freebody, tab4, NIL);
|
Printv(freebody, tab4, NIL);
|
||||||
|
|
@ -2353,11 +2358,9 @@ public:
|
||||||
Swig_typemap_attach_parms("directorin", l, 0);
|
Swig_typemap_attach_parms("directorin", l, 0);
|
||||||
Swig_typemap_attach_parms("directorargout", l, w);
|
Swig_typemap_attach_parms("directorargout", l, w);
|
||||||
|
|
||||||
int num_arguments = emit_num_arguments(l);
|
|
||||||
char source[256];
|
char source[256];
|
||||||
|
|
||||||
int outputs = 0;
|
int outputs = 0;
|
||||||
|
|
||||||
if (!is_void && !asvoid)
|
if (!is_void && !asvoid)
|
||||||
outputs++;
|
outputs++;
|
||||||
|
|
||||||
|
|
@ -2485,7 +2488,7 @@ public:
|
||||||
if (outputs > 1) {
|
if (outputs > 1) {
|
||||||
Wrapper_add_local(w, "output", "VALUE output");
|
Wrapper_add_local(w, "output", "VALUE output");
|
||||||
Printf(w->code, "if (TYPE(result) != T_ARRAY) {\n");
|
Printf(w->code, "if (TYPE(result) != T_ARRAY) {\n");
|
||||||
Printf(w->code, "throw Swig::DirectorTypeMismatchException(\"Ruby method failed to return an array.\");\n");
|
Printf(w->code, "Ruby_DirectorTypeMismatchException(\"Ruby method failed to return an array.\");\n");
|
||||||
Printf(w->code, "}\n");
|
Printf(w->code, "}\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue