Skip to content

Commit

Permalink
Refs #21759. Fix memory leak
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
  • Loading branch information
richiware committed Sep 27, 2024
1 parent 04d1fd7 commit 5987c66
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,24 @@ TypeLookupManager::~TypeLookupManager()

delete temp_reader_proxy_data_;
delete temp_writer_proxy_data_;

for (auto& writer_entry : async_get_type_writer_callbacks_)
{
// Delete the proxies and remove the entry
for (auto& proxy_callback_pair : writer_entry.second)
{
delete proxy_callback_pair.first;
}
}

for (auto& reader_entry : async_get_type_reader_callbacks_)
{
// Delete the proxies and remove the entry
for (auto& proxy_callback_pair : reader_entry.second)
{
delete proxy_callback_pair.first;
}
}
}

bool TypeLookupManager::init(
Expand Down

0 comments on commit 5987c66

Please sign in to comment.