Skip to content

Commit

Permalink
Merge pull request #235 from josebraga/bugfix/nav-leak
Browse files Browse the repository at this point in the history
DUNE/Navigation/BasicNavigation: initialize and release m_usbl_filter…
  • Loading branch information
luis109 authored May 5, 2022
2 parents cb3519e + 8ebddb0 commit bd93254
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/DUNE/Navigation/BasicNavigation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ namespace DUNE
BasicNavigation::BasicNavigation(const std::string& name, Tasks::Context& ctx):
Tasks::Periodic(name, ctx),
m_active(false),
m_origin(NULL),
m_avg_heave(NULL),
m_avg_gps(NULL)
m_origin(nullptr),
m_avg_heave(nullptr),
m_avg_gps(nullptr),
m_usbl_filter(nullptr)
{
// Declare configuration parameters.
param("Maximum Distance to Reference", m_max_dis2ref)
Expand Down Expand Up @@ -346,6 +347,7 @@ namespace DUNE
Memory::clear(m_origin);
Memory::clear(m_avg_heave);
Memory::clear(m_avg_gps);
Memory::clear(m_usbl_filter);
}

void
Expand Down Expand Up @@ -896,7 +898,7 @@ namespace DUNE
{
reset();

if (m_origin == NULL)
if (m_origin == nullptr)
return false;

m_estate.lat = m_origin->lat;
Expand Down
8 changes: 4 additions & 4 deletions src/DUNE/Navigation/BasicNavigation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,19 @@ namespace DUNE

//! Update internal parameters.
virtual void
onUpdateParameters(void);
onUpdateParameters(void) override;

//! Resolve entities.
virtual void
onEntityResolution(void);
onEntityResolution(void) override;

//! Initialize resources.
virtual void
onResourceInitialization(void);
onResourceInitialization(void) override;

//! Release allocated resources.
virtual void
onResourceRelease(void);
onResourceRelease(void) override;

void
consume(const IMC::Acceleration* msg);
Expand Down

0 comments on commit bd93254

Please sign in to comment.