Skip to content

Commit

Permalink
Fix memory leak deleting TypeLookupManager (#5273)
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo González Moreno <[email protected]>
  • Loading branch information
richiware authored Sep 30, 2024
1 parent 175add5 commit dd0f7f2
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 dd0f7f2

Please sign in to comment.