better logic for finalization

This commit is contained in:
Sharan Roongta 2020-04-23 17:10:33 +02:00
parent 11c4ff7787
commit 7fe2a52b65
1 changed files with 5 additions and 5 deletions

View File

@ -214,7 +214,7 @@ subroutine unitTest
call l1%append(s2) call l1%append(s2)
call l2%append(l1) call l2%append(l1)
n=> l1 n=> l1
if(any(l1%asBools() .neqv. [.true., .false.])) call IO_error(0,ext_msg='tList_asBools') 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(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') 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, & type (tItem),pointer :: current, &
next next
current => self%first current => self%first
do while (associated(current)) do while (associated(current))
next => current%next next => current%next
deallocate(current%node) deallocate(current)
current => next current => next
end do end do
nullify(self%first)
end subroutine tDict_finalize end subroutine tDict_finalize
@ -981,13 +981,13 @@ recursive subroutine tList_finalize(self)
type (tItem),pointer :: current, & type (tItem),pointer :: current, &
next next
current => self%first current => self%first
do while (associated(current)) do while (associated(current))
next => current%next next => current%next
if(allocated(current%node)) deallocate(current%node) deallocate(current)
current => next current => next
end do end do
nullify(self%first)
end subroutine tList_finalize end subroutine tList_finalize