Skip to content

Commit

Permalink
mavlink: Add cleanups to the destructor
Browse files Browse the repository at this point in the history
Unsubscribe & unadvertise topics which were subscribed/advertised in the constructor

Signed-off-by: Jukka Laitinen <[email protected]>
  • Loading branch information
jlaitine committed Jan 10, 2025
1 parent d8b70ca commit 9c84880
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/modules/mavlink/mavlink_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ Mavlink::~Mavlink()

delete _stream_poller;

_telemetry_status_pub.unadvertise();
_event_sub.unsubscribe();
_vehicle_command_sub.unsubscribe();

perf_free(_loop_perf);
perf_free(_loop_interval_perf);
perf_free(_send_byte_error_perf);
Expand Down

0 comments on commit 9c84880

Please sign in to comment.