[lua] Run destructors of local C++ objects on SWIG_fail

Arrange that destructors of local C++ objects in the wrapper function
get run on SWIG_fail (which calls lua_error() which calls longjmp()).

We achieve this by putting almost everything in the function in its
own block, and end that right before lua_error() at which point those
destructors will get called.
This commit is contained in:
Olly Betts 2022-10-13 18:27:48 +13:00 • committed by Olly Betts
commit 9ab9c71623
4 changed files with 58 additions and 4 deletions

View file

@ -7,6 +7,11 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
Version 4.1.0 (in progress)
===========================
2022-10-14: olly
[Lua] Arrange that destructors of local C++ objects in the wrapper
function get run on SWIG_fail (which calls lua_error() which calls
longjmp()).
2022-10-13: wsfulton
[R] Add missing SWIGTYPE *const& typemaps for supporting pointers
by const reference.