Skip to content

has_invalid_weak_nodes can only ever be false #264

Closed

Description

@gbiggs

In allocator_memory_strategy.hpp in the function collect_entities, the variable has_invalid_weak_nodes looks to me like it can only ever be false.

bool has_invalid_weak_nodes = false;

Is the correct behaviour for line 147 to set the value to true?

Activity

  1. wjwwood commented on Nov 1, 2016

    @wjwwood
    Member

    I think this line is wrong:

    It should be = true here.

  2. wjwwood commented on Nov 1, 2016

    @wjwwood
    Member

    Think you could open a pr that fixes that? I think it means that essentially no invalid nodes are ever removed from this list:

    bool has_invalid_weak_nodes = memory_strategy_->collect_entities(weak_nodes_);
    // Clean up any invalid nodes, if they were detected
    if (has_invalid_weak_nodes) {
    weak_nodes_.erase(
    remove_if(
    weak_nodes_.begin(), weak_nodes_.end(),
    // *INDENT-OFF* (prevent uncrustify from making unnecessary indents here)
    [](std::weak_ptr<rclcpp::node::Node> i)
    {
    return i.expired();
    }
    // *INDENT-ON*
    )
    );
    }

  3. added a commit that references this issue on Nov 17, 2016
    9638a00
  4. added a commit that references this issue on Nov 17, 2016
    aa2d0a3
  5. added a commit that references this issue on Nov 18, 2016
    c30a020
  6. added a commit that references this issue on Dec 7, 2016
    2392082
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions