Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving a sparta::Counter doesn't clean up the StatisticSet #245

Open
ghost opened this issue May 7, 2021 · 1 comment
Open

Moving a sparta::Counter doesn't clean up the StatisticSet #245

ghost opened this issue May 7, 2021 · 1 comment
Assignees
Labels
bug Something isn't working component: sparta Issue is related to sparta framework

Comments

@ghost
Copy link

ghost commented May 7, 2021

After moving a sparta::Counter, the StatisticSet isn't cleaned up -- it has two pointers -- one to the old counter (now deleted) and the new one. The TreeNode supports detaching from parent, but the method onDestroyingChild doesn't appear to be implemented in StatisticSet.

ghost pushed a commit that referenced this issue May 7, 2021
Filed #245 with std::move
issue and StatisticSet
klingaard pushed a commit that referenced this issue May 8, 2021
Filed #245 with std::move
issue and StatisticSet
github-actions bot pushed a commit that referenced this issue May 8, 2021
Filed #245 with std::move
issue and StatisticSet 167a1ba
@ghost ghost added the bug Something isn't working label May 25, 2021
@klingaard klingaard self-assigned this Jan 30, 2022
@klingaard klingaard added the component: sparta Issue is related to sparta framework label Jan 30, 2022
@klingaard
Copy link
Member

klingaard commented Jan 30, 2022

Updated Statistic_test with an example of this and it's broken:

    TreeNode dummy2(&root, "dummy2", "A second dummy node");
    sparta::StatisticSet moved_stats_set(&dummy2);
    sparta::Counter orig_counter(&moved_stats_set, "moved_stat", "A stat to be moved", Counter::COUNT_NORMAL);
    EXPECT_EQUAL(moved_stats_set.getNumCounters(), 1);
    sparta::Counter moved_counter(std::move(orig_counter));
    EXPECT_EQUAL(moved_stats_set.getNumCounters(), 1);  // <<--- ERROR: reports 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component: sparta Issue is related to sparta framework
Projects
None yet
Development

No branches or pull requests

1 participant