Skip to content

Commit

Permalink
Fix remaining leaks in test_string_map.cpp (ros2#151)
Browse files Browse the repository at this point in the history
This change prevents leaks in test_string_map by relying
on OSRF_TESTING_TOOLS_CPP_SCOPE_EXIT to consisdently free
memory even if an exception is thrown.

This also adds a call to:
    set_failing_allocator_is_failing(failing_allocator, true);
...before calling rcutils_string_map_fini() in the test cases
where a failling allocator is used.

Before this change, this was not always the case preventing
the memory from being actually freed.

Fixes ros2#146

Signed-off-by: Thomas Moulard <tmoulard@amazon.com>
  • Loading branch information
thomas-moulard authored and wjwwood committed Apr 17, 2019
1 parent 139916e commit de45471
Showing 1 changed file with 249 additions and 140 deletions.
Loading

0 comments on commit de45471

Please sign in to comment.