[PHP] Fix code generated for feature("director:except")
Previously the return value of call_user_function() was ignored and we checked an uninitialised value instead. Fixes #627. Based on patch from Sergey Seroshtan.
This commit is contained in:
parent
0769e9b727
commit
1adfe2f537
3 changed files with 26 additions and 0 deletions
|
|
@ -28,6 +28,21 @@ class DirectorMethodException: public Swig::DirectorException {};
|
|||
|
||||
%include "std_string.i"
|
||||
|
||||
#ifdef SWIGPHP
|
||||
|
||||
%feature("director:except") {
|
||||
if ($error == FAILURE) {
|
||||
throw Swig::DirectorMethodException();
|
||||
}
|
||||
}
|
||||
|
||||
%exception {
|
||||
try { $action }
|
||||
catch (Swig::DirectorException &) { SWIG_fail; }
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef SWIGPYTHON
|
||||
|
||||
%feature("director:except") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue