Don't leak the pointer returned by SWIG_CException::get_pending()
This pointer is always new (if non-null) and so must be deleted.
This commit is contained in:
parent
d33e76e045
commit
19e0ecbb9d
1 changed files with 1 additions and 0 deletions
|
|
@ -271,6 +271,7 @@ struct cxx_wrappers
|
|||
"inline void swig_check() {\n",
|
||||
cindent, "if (SWIG_CException* swig_ex = SWIG_CException::get_pending()) {\n",
|
||||
cindent, cindent, "SWIG_CException swig_ex_copy{*swig_ex};\n",
|
||||
cindent, cindent, "delete swig_ex;\n",
|
||||
cindent, cindent, "SWIG_CException::reset_pending();\n",
|
||||
cindent, cindent, "throw swig_ex_copy;\n",
|
||||
cindent, "}\n",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue