[Go] Don't emit a constructor function for a director class with an
abstract method, since the function will always panic. Fixes #435.
This commit is contained in:
parent
9104adc60a
commit
7e40e523c3
2 changed files with 13 additions and 2 deletions
|
|
@ -785,6 +785,13 @@ private:
|
|||
return SWIG_OK;
|
||||
}
|
||||
|
||||
// Don't emit constructors for abstract director classes. They
|
||||
// will never succeed anyhow.
|
||||
if (Swig_methodclass(n) && Swig_directorclass(n)
|
||||
&& Strcmp(Char(Getattr(n, "wrap:action")), director_prot_ctor_code) == 0) {
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
String *name = Getattr(n, "sym:name");
|
||||
String *nodetype = Getattr(n, "nodeType");
|
||||
bool is_static = is_static_member_function || isStatic(n);
|
||||
|
|
@ -848,8 +855,7 @@ private:
|
|||
Delete(c2);
|
||||
Delete(c1);
|
||||
|
||||
if (Swig_methodclass(n) && Swig_directorclass(n)
|
||||
&& Strcmp(Char(Getattr(n, "wrap:action")), director_prot_ctor_code) != 0) {
|
||||
if (Swig_methodclass(n) && Swig_directorclass(n)) {
|
||||
// The core SWIG code skips the first parameter when
|
||||
// generating the $nondirector_new string. Recreate the
|
||||
// action in this case. But don't it if we are using the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue