free valid_transitions for all states (#537)
* free valid_transitions for all states transition_map->states[i].valid_transitions wasn't being release which was leaking about 800 bytes per instantiation. See https://github.com/aliasrobotics/RVD/issues/333 Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com> * Fixups. Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
This commit is contained in:
parent
8af6f174e3
commit
fbe299af7f
1 changed files with 7 additions and 0 deletions
|
@ -55,6 +55,13 @@ rcl_lifecycle_transition_map_fini(
|
||||||
{
|
{
|
||||||
rcl_ret_t fcn_ret = RCL_RET_OK;
|
rcl_ret_t fcn_ret = RCL_RET_OK;
|
||||||
|
|
||||||
|
// free valid transitions for all states
|
||||||
|
for (unsigned int i = 0; i < transition_map->states_size; ++i) {
|
||||||
|
if (transition_map->states[i].valid_transitions != NULL) {
|
||||||
|
allocator->deallocate(transition_map->states[i].valid_transitions, allocator->state);
|
||||||
|
transition_map->states[i].valid_transitions = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
// free the primary states
|
// free the primary states
|
||||||
allocator->deallocate(transition_map->states, allocator->state);
|
allocator->deallocate(transition_map->states, allocator->state);
|
||||||
transition_map->states = NULL;
|
transition_map->states = NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue