Closed Steven-Roberts closed 7 months ago
This call to SUNErrHandler_Destory
should be replaced with SUNContext_ClearErrHandlers
Ah great, there's already a function to do that. I swapped in SUNContext_ClearErrHandlers
and valgrind reports no leaks. I'll turn it into a PR.
Closed by #467
If more than default error handler is added to a
SUNContext
, it does not get free'd inSUNContext_Free
.https://github.com/LLNL/sundials/blob/2abd63bd6cbc354fb4861bba8e98d0b95d65e24a/src/sundials/sundials_context.c#L288
https://github.com/LLNL/sundials/blob/2abd63bd6cbc354fb4861bba8e98d0b95d65e24a/src/sundials/sundials_errors.c#L42-L47
Either
SUNContext_Free
orSUNErrHandler_Destroy
should traverse the list of error handlers throughsunctx->err_handler->previous
to free each.