From 9c8488071e51ec995bac070b77876b61560e0ac2 Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Fri, 10 Jan 2025 15:04:04 +0200 Subject: [PATCH] mavlink: Add cleanups to the destructor Unsubscribe & unadvertise topics which were subscribed/advertised in the constructor Signed-off-by: Jukka Laitinen --- src/modules/mavlink/mavlink_main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/mavlink/mavlink_main.cpp b/src/modules/mavlink/mavlink_main.cpp index 700865dae6ac..cfd5f2e9cbbd 100644 --- a/src/modules/mavlink/mavlink_main.cpp +++ b/src/modules/mavlink/mavlink_main.cpp @@ -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);