diff --git a/platforms/common/include/px4_platform_common/module_params.h b/platforms/common/include/px4_platform_common/module_params.h index 7d954e09087..c88ade7d9ca 100644 --- a/platforms/common/include/px4_platform_common/module_params.h +++ b/platforms/common/include/px4_platform_common/module_params.h @@ -71,14 +71,7 @@ protected: * @brief Call this method whenever the module gets a parameter change notification. * It will automatically call updateParams() for all children, which then call updateParamsImpl(). */ - virtual void updateParams() - { - for (const auto &child : _children) { - child->updateParams(); - } - - updateParamsImpl(); - } + virtual void updateParams(); /** * @brief The implementation for this is generated with the macro DEFINE_PARAMETERS() diff --git a/platforms/common/module_params.cpp b/platforms/common/module_params.cpp index 1ae4e4cafc2..f39995e3afa 100644 --- a/platforms/common/module_params.cpp +++ b/platforms/common/module_params.cpp @@ -42,6 +42,15 @@ void ModuleParams::setParent(ModuleParams *parent) _parent = parent; } +void ModuleParams::updateParams() +{ + for (const auto &child : _children) { + child->updateParams(); + } + + updateParamsImpl(); +} + ModuleParams::~ModuleParams() { if (_parent) { _parent->_children.remove(this); }