From 7fe2a52b65eb8e22aeadb731a95818504e6c1f9d Mon Sep 17 00:00:00 2001 From: Sharan Roongta Date: Thu, 23 Apr 2020 17:10:33 +0200 Subject: [PATCH] better logic for finalization --- src/YAML_types.f90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/YAML_types.f90 b/src/YAML_types.f90 index 2edff3a58..e951c2c83 100644 --- a/src/YAML_types.f90 +++ b/src/YAML_types.f90 @@ -214,7 +214,7 @@ subroutine unitTest call l1%append(s2) call l2%append(l1) n=> l1 - + if(any(l1%asBools() .neqv. [.true., .false.])) call IO_error(0,ext_msg='tList_asBools') if(any(l1%asStrings() /= ['True ','False'])) call IO_error(0,ext_msg='tList_asStrings') if(n%get_asBool(2)) call IO_error(0,ext_msg='byIndex_asBool') @@ -960,13 +960,13 @@ recursive subroutine tDict_finalize(self) type (tItem),pointer :: current, & next + current => self%first do while (associated(current)) next => current%next - deallocate(current%node) + deallocate(current) current => next end do - nullify(self%first) end subroutine tDict_finalize @@ -981,13 +981,13 @@ recursive subroutine tList_finalize(self) type (tItem),pointer :: current, & next + current => self%first do while (associated(current)) next => current%next - if(allocated(current%node)) deallocate(current%node) + deallocate(current) current => next end do - nullify(self%first) end subroutine tList_finalize