From 5fbdfb14361a1419e0626166935d9524c151655a Mon Sep 17 00:00:00 2001 From: sfilippone Date: Thu, 16 Nov 2023 17:55:24 +0100 Subject: [PATCH] Fix free for jac_solver --- amgprec/amg_c_jac_solver.f90 | 5 ++++- amgprec/amg_d_jac_solver.f90 | 5 ++++- amgprec/amg_s_jac_solver.f90 | 5 ++++- amgprec/amg_z_jac_solver.f90 | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/amgprec/amg_c_jac_solver.f90 b/amgprec/amg_c_jac_solver.f90 index 55335f1b..90ed85ce 100644 --- a/amgprec/amg_c_jac_solver.f90 +++ b/amgprec/amg_c_jac_solver.f90 @@ -403,7 +403,10 @@ contains info = psb_success_ call sv%a%free() - call sv%dv%free(info) + if (allocated(sv%dv)) then + call sv%dv%free(info) + deallocate(sv%dv) + end if if (allocated(sv%d)) deallocate(sv%d) call psb_erractionrestore(err_act) diff --git a/amgprec/amg_d_jac_solver.f90 b/amgprec/amg_d_jac_solver.f90 index 25bb1375..eb7c93ce 100644 --- a/amgprec/amg_d_jac_solver.f90 +++ b/amgprec/amg_d_jac_solver.f90 @@ -403,7 +403,10 @@ contains info = psb_success_ call sv%a%free() - call sv%dv%free(info) + if (allocated(sv%dv)) then + call sv%dv%free(info) + deallocate(sv%dv) + end if if (allocated(sv%d)) deallocate(sv%d) call psb_erractionrestore(err_act) diff --git a/amgprec/amg_s_jac_solver.f90 b/amgprec/amg_s_jac_solver.f90 index 8cc66bbc..0ecbd10d 100644 --- a/amgprec/amg_s_jac_solver.f90 +++ b/amgprec/amg_s_jac_solver.f90 @@ -403,7 +403,10 @@ contains info = psb_success_ call sv%a%free() - call sv%dv%free(info) + if (allocated(sv%dv)) then + call sv%dv%free(info) + deallocate(sv%dv) + end if if (allocated(sv%d)) deallocate(sv%d) call psb_erractionrestore(err_act) diff --git a/amgprec/amg_z_jac_solver.f90 b/amgprec/amg_z_jac_solver.f90 index 28f1199e..5d273537 100644 --- a/amgprec/amg_z_jac_solver.f90 +++ b/amgprec/amg_z_jac_solver.f90 @@ -403,7 +403,10 @@ contains info = psb_success_ call sv%a%free() - call sv%dv%free(info) + if (allocated(sv%dv)) then + call sv%dv%free(info) + deallocate(sv%dv) + end if if (allocated(sv%d)) deallocate(sv%d) call psb_erractionrestore(err_act)