forked from Archive/PX4-Autopilot
mavlink: properly cleanup instance on exit
This commit is contained in:
parent
9f87702074
commit
328c5cb1cf
|
@ -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};
|
||||
|
|
Loading…
Reference in New Issue