Fix R memory leak on exception

There is a possible memory leak in case the SWIG_exception_fail macro
is called. The problem is related to its definition that call the
function Rf_warning. This function (as well as Rf_error) involves
a longjmp over C++ destructors on the stack. Thus, all the objects
allocated on the heap are not freed.

Closes #914
This commit is contained in:
Arnaud Barré 2020-01-30 19:52:53 +00:00 • committed by William S Fulton
commit 3fa5c8c652
6 changed files with 129 additions and 8 deletions

View file

@ -18,6 +18,7 @@ C_TEST_CASES += \
CPP_TEST_CASES += \
r_double_delete \
r_memory_leak \
r_overload_array \
r_sexp \
r_overload_comma \