mavlink: stop ulog streaming when mavlink thread exits

'mavlink stop-all' during a log streaming session previously led to a
resource leak, and log streaming could only be re-started by rebooting the
system.
This commit is contained in:
Beat Küng
2016-11-04 10:24:12 +01:00
committed by Lorenz Meier
parent 587c5161a3
commit ab4d7dfc59

View File

@@ -2356,6 +2356,11 @@ Mavlink::task_main(int argc, char *argv[])
pthread_mutex_destroy(&_message_buffer_mutex);
}
if (_mavlink_ulog) {
_mavlink_ulog->stop();
_mavlink_ulog = nullptr;
}
warnx("exiting channel %i", (int)_channel);
return OK;