vmount: properly unadvertise uorb topics when stopping or re-configuring vmount. Othwerise subsequent advertise calls may fail (only ever witnessed for _mount_orientation_pub)

This commit is contained in:
Nicolas de Palezieux 2017-08-10 16:03:36 +02:00 committed by Beat Küng
parent cbe3627b8c
commit b8d389ca4e
3 changed files with 12 additions and 1 deletions

View File

@ -68,6 +68,10 @@ OutputBase::~OutputBase()
if (_vehicle_global_position_sub >= 0) {
orb_unsubscribe(_vehicle_global_position_sub);
}
if (_mount_orientation_pub) {
orb_unadvertise(_mount_orientation_pub);
}
}
int OutputBase::initialize()

View File

@ -52,6 +52,13 @@ OutputMavlink::OutputMavlink(const OutputConfig &output_config)
{
}
OutputMavlink::~OutputMavlink()
{
if (_vehicle_command_pub) {
orb_unadvertise(_vehicle_command_pub);
}
}
int OutputMavlink::update(const ControlData *control_data)
{
vehicle_command_s vehicle_command = {

View File

@ -56,7 +56,7 @@ class OutputMavlink : public OutputBase
{
public:
OutputMavlink(const OutputConfig &output_config);
virtual ~OutputMavlink() { }
~OutputMavlink();
virtual int update(const ControlData *control_data);