better logic for finalization
This commit is contained in:
parent
11c4ff7787
commit
7fe2a52b65
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue