From 5fae142bbc1dfd5074a7832bb4ec1b14d96b8008 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 10 Feb 2015 15:13:31 +0100 Subject: [PATCH] Delete stream name in same thread as where its created --- src/modules/mavlink/mavlink_main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/mavlink/mavlink_main.cpp b/src/modules/mavlink/mavlink_main.cpp index 79a35f1e77..fa91015cd0 100644 --- a/src/modules/mavlink/mavlink_main.cpp +++ b/src/modules/mavlink/mavlink_main.cpp @@ -1027,6 +1027,8 @@ Mavlink::configure_stream_threadsafe(const char *stream_name, const float rate) do { usleep(MAIN_LOOP_DELAY / 2); } while (_subscribe_to_stream != nullptr); + + delete s; } } @@ -1448,7 +1450,6 @@ Mavlink::task_main(int argc, char *argv[]) warnx("stream %s on device %s not found", _subscribe_to_stream, _device_name); } - delete _subscribe_to_stream; _subscribe_to_stream = nullptr; }