[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
|
|
@ -5,6 +5,11 @@ See the RELEASENOTES file for a summary of changes in each release.
|
|||
Version 3.0.8 (in progress)
|
||||
===========================
|
||||
|
||||
2015-10-06: ianlancetaylor
|
||||
[Go] Don't emit a constructor function for a director
|
||||
class with an abstract method, since the function will
|
||||
always panic.
|
||||
|
||||
2015-10-01: wsfulton
|
||||
Fix %shared_ptr support for private and protected inheritance.
|
||||
- Remove unnecessary Warning 520: Derived class 'Derived' of 'Base'
|
||||
|
|
|
|||
|
|
@ -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