mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
mavlink: properly cleanup instance on exit
This commit is contained in:
@@ -147,6 +147,10 @@ Mavlink::~Mavlink()
|
||||
} while (_task_running);
|
||||
}
|
||||
|
||||
if (_instance_id >= 0) {
|
||||
mavlink_module_instances[_instance_id] = nullptr;
|
||||
}
|
||||
|
||||
perf_free(_loop_perf);
|
||||
perf_free(_loop_interval_perf);
|
||||
perf_free(_send_byte_error_perf);
|
||||
@@ -2546,6 +2550,8 @@ Mavlink::task_main(int argc, char *argv[])
|
||||
|
||||
pthread_mutex_destroy(&_send_mutex);
|
||||
|
||||
_task_running = false;
|
||||
|
||||
PX4_INFO("exiting channel %i", (int)_channel);
|
||||
|
||||
return OK;
|
||||
|
||||
@@ -529,7 +529,7 @@ public:
|
||||
|
||||
private:
|
||||
MavlinkReceiver _receiver;
|
||||
int _instance_id{0};
|
||||
int _instance_id{-1};
|
||||
|
||||
bool _transmitting_enabled{true};
|
||||
bool _transmitting_enabled_commanded{false};
|
||||
|
||||
Reference in New Issue
Block a user