From a83ccc7f5273690d8f81f676156f0f92410ca97b Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Tue, 12 May 2020 14:31:57 +0200 Subject: [PATCH] Improve checks for SLU/SLUDIST %free() --- mlprec/mld_c_slu_solver.F90 | 5 ++--- mlprec/mld_d_slu_solver.F90 | 5 ++--- mlprec/mld_d_sludist_solver.F90 | 6 ++---- mlprec/mld_s_slu_solver.F90 | 5 ++--- mlprec/mld_z_slu_solver.F90 | 5 ++--- mlprec/mld_z_sludist_solver.F90 | 6 ++---- 6 files changed, 12 insertions(+), 20 deletions(-) diff --git a/mlprec/mld_c_slu_solver.F90 b/mlprec/mld_c_slu_solver.F90 index 84cebbdc..8dcf6a9c 100644 --- a/mlprec/mld_c_slu_solver.F90 +++ b/mlprec/mld_c_slu_solver.F90 @@ -332,9 +332,8 @@ contains call psb_erractionsave(err_act) - if (c_associated(sv%lufactors)) then - info = mld_cslu_free(sv%lufactors) - end if + info = psb_success_ + if (c_associated(sv%lufactors)) info = mld_cslu_free(sv%lufactors) sv%lufactors = c_null_ptr if (info /= psb_success_) goto 9999 diff --git a/mlprec/mld_d_slu_solver.F90 b/mlprec/mld_d_slu_solver.F90 index ec1b4744..8c27650f 100644 --- a/mlprec/mld_d_slu_solver.F90 +++ b/mlprec/mld_d_slu_solver.F90 @@ -332,9 +332,8 @@ contains call psb_erractionsave(err_act) - if (c_associated(sv%lufactors)) then - info = mld_dslu_free(sv%lufactors) - end if + info = psb_success_ + if (c_associated(sv%lufactors)) info = mld_dslu_free(sv%lufactors) sv%lufactors = c_null_ptr if (info /= psb_success_) goto 9999 diff --git a/mlprec/mld_d_sludist_solver.F90 b/mlprec/mld_d_sludist_solver.F90 index 46173b59..52f4cd2c 100644 --- a/mlprec/mld_d_sludist_solver.F90 +++ b/mlprec/mld_d_sludist_solver.F90 @@ -343,10 +343,8 @@ contains call psb_erractionsave(err_act) - - if (c_associated(sv%lufactors)) then - info = mld_dsludist_free(sv%lufactors) - end if + info = psb_success_ + if (c_associated(sv%lufactors)) info = mld_dsludist_free(sv%lufactors) sv%lufactors = c_null_ptr if (info /= psb_success_) goto 9999 diff --git a/mlprec/mld_s_slu_solver.F90 b/mlprec/mld_s_slu_solver.F90 index c8d3d4fc..99df4592 100644 --- a/mlprec/mld_s_slu_solver.F90 +++ b/mlprec/mld_s_slu_solver.F90 @@ -332,9 +332,8 @@ contains call psb_erractionsave(err_act) - if (c_associated(sv%lufactors)) then - info = mld_sslu_free(sv%lufactors) - end if + info = psb_success_ + if (c_associated(sv%lufactors)) info = mld_sslu_free(sv%lufactors) sv%lufactors = c_null_ptr if (info /= psb_success_) goto 9999 diff --git a/mlprec/mld_z_slu_solver.F90 b/mlprec/mld_z_slu_solver.F90 index 7322f4f3..7c329682 100644 --- a/mlprec/mld_z_slu_solver.F90 +++ b/mlprec/mld_z_slu_solver.F90 @@ -332,9 +332,8 @@ contains call psb_erractionsave(err_act) - if (c_associated(sv%lufactors)) then - info = mld_zslu_free(sv%lufactors) - end if + info = psb_success_ + if (c_associated(sv%lufactors)) info = mld_zslu_free(sv%lufactors) sv%lufactors = c_null_ptr if (info /= psb_success_) goto 9999 diff --git a/mlprec/mld_z_sludist_solver.F90 b/mlprec/mld_z_sludist_solver.F90 index f8b8b645..2b2cece7 100644 --- a/mlprec/mld_z_sludist_solver.F90 +++ b/mlprec/mld_z_sludist_solver.F90 @@ -343,10 +343,8 @@ contains call psb_erractionsave(err_act) - - if (c_associated(sv%lufactors)) then - info = mld_zsludist_free(sv%lufactors) - end if + info = psb_success_ + if (c_associated(sv%lufactors)) info = mld_zsludist_free(sv%lufactors) sv%lufactors = c_null_ptr if (info /= psb_success_) goto 9999