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:
Vadim Zeitlin 2021-12-03 03:38:04 +01:00
commit 19e0ecbb9d

View file

@ -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",