From 1ae3cc135f00c5406f8f955dc9807a0969c0e86b Mon Sep 17 00:00:00 2001 From: sfilippone Date: Mon, 4 May 2026 20:50:34 +0200 Subject: [PATCH] Improve error handling for prec%free --- amgprec/amg_c_prec_type.f90 | 5 +++++ amgprec/amg_d_prec_type.f90 | 5 +++++ amgprec/amg_s_prec_type.f90 | 5 +++++ amgprec/amg_z_prec_type.f90 | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/amgprec/amg_c_prec_type.f90 b/amgprec/amg_c_prec_type.f90 index 6cb59939..0359efdd 100644 --- a/amgprec/amg_c_prec_type.f90 +++ b/amgprec/amg_c_prec_type.f90 @@ -636,6 +636,11 @@ contains if (allocated(prec%precv)) then do i=1,size(prec%precv) call prec%precv(i)%free(info) + if (psb_errstatus_fatal()) then + info=psb_err_internal_error_ + call psb_errpush(info,name) + goto 9999 + end if end do deallocate(prec%precv,stat=info) end if diff --git a/amgprec/amg_d_prec_type.f90 b/amgprec/amg_d_prec_type.f90 index 4ff41d15..1a9a932e 100644 --- a/amgprec/amg_d_prec_type.f90 +++ b/amgprec/amg_d_prec_type.f90 @@ -636,6 +636,11 @@ contains if (allocated(prec%precv)) then do i=1,size(prec%precv) call prec%precv(i)%free(info) + if (psb_errstatus_fatal()) then + info=psb_err_internal_error_ + call psb_errpush(info,name) + goto 9999 + end if end do deallocate(prec%precv,stat=info) end if diff --git a/amgprec/amg_s_prec_type.f90 b/amgprec/amg_s_prec_type.f90 index 68ff409b..ea87bbf3 100644 --- a/amgprec/amg_s_prec_type.f90 +++ b/amgprec/amg_s_prec_type.f90 @@ -636,6 +636,11 @@ contains if (allocated(prec%precv)) then do i=1,size(prec%precv) call prec%precv(i)%free(info) + if (psb_errstatus_fatal()) then + info=psb_err_internal_error_ + call psb_errpush(info,name) + goto 9999 + end if end do deallocate(prec%precv,stat=info) end if diff --git a/amgprec/amg_z_prec_type.f90 b/amgprec/amg_z_prec_type.f90 index 7bc73992..9d44ca06 100644 --- a/amgprec/amg_z_prec_type.f90 +++ b/amgprec/amg_z_prec_type.f90 @@ -636,6 +636,11 @@ contains if (allocated(prec%precv)) then do i=1,size(prec%precv) call prec%precv(i)%free(info) + if (psb_errstatus_fatal()) then + info=psb_err_internal_error_ + call psb_errpush(info,name) + goto 9999 + end if end do deallocate(prec%precv,stat=info) end if