Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix memory leak when adding the same key to the logger hash map multi…
…ple times (#391) The first time a key is added the hash map will retain a copy of the pointer and later will deallocate the memory during shutdown. Subsequent times the same key is added to the hash map, it will NOT retain a copy of the new pointer, and hence not deallocate the memory during shutdown. This fixes the issue by checking if we're adding an entry for an existing key and if so, avoid allocating new memory. Signed-off-by: Jacob Perron <jacob@openrobotics.org>
- Loading branch information