sllist_obj_Free Subroutine

private pure recursive subroutine sllist_obj_Free(this)

Free all data associated with this list.

Type Bound

sllist_obj

Arguments

Type IntentOptional Attributes Name
class(sllist_obj), intent(inout) :: this

List object


Source Code

    pure recursive subroutine sllist_obj_Free(this)
      !> Free all data associated with this list.
      implicit none
      class(sllist_obj), intent(inout) :: this                                 !! List object

      if (associated(this%child)) then
        call sllist_obj_Free(this%child)
        deallocate(this%child)
      end if
      this%child => null()
      this%key = -1
      if (allocated(this%val)) deallocate(this%val)

      return
    end subroutine sllist_obj_Free