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

@ -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