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, &
|
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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue