destroy_node_data Subroutine

private impure elemental subroutine destroy_node_data(me)

destroy the data in the node.

Type Bound

node

Arguments

Type IntentOptional Attributes Name
class(node), intent(inout) :: me

Called by

proc~~destroy_node_data~~CalledByGraph proc~destroy_node_data node%destroy_node_data proc~destroy_node destroy_node proc~destroy_node->proc~destroy_node_data proc~destroy_node->proc~destroy_node proc~remove_by_pointer list%remove_by_pointer proc~remove_by_pointer->proc~destroy_node_data proc~add_pointer list%add_pointer proc~add_pointer->proc~remove_by_pointer proc~destroy_list list%destroy_list proc~destroy_list->proc~destroy_node proc~remove_by_key list%remove_by_key proc~remove_by_key->proc~remove_by_pointer proc~add_clone list%add_clone proc~add_clone->proc~add_pointer proc~list_finalizer list_finalizer proc~list_finalizer->proc~destroy_list

Source Code

    impure elemental subroutine destroy_node_data(me)

    implicit none

    class(node),intent(inout) :: me

    if (allocated(me%key)) deallocate(me%key)

    if (me%destroy_on_delete) then
        ! deallocates the pointer (and call any finalizer)
        ! (otherwise, it is up to the caller to do this)
        if (associated(me%value)) deallocate(me%value)
    end if

    nullify(me%value)

    end subroutine destroy_node_data