destroy Subroutine
private recursive subroutine destroy(this)
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(vector), | intent(inout) | :: | this |
Variables
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(vector_iterator), | public | :: | i | ||||
class(*), | public, | pointer | :: | my_stuff |
Source Code
recursive subroutine destroy(this)
type(vector),intent(inout) :: this
type(vector_iterator) :: i
class(*), pointer :: my_stuff
print *, 'vector%destroy begin'
i = this%iter()
do while(i%next(my_stuff))
if(associated(my_stuff)) then
deallocate(my_stuff)
end if
end do
print *, 'vector%destroy end'
end subroutine destroy