Delete stream name in same thread as where its created

This commit is contained in:
Lorenz Meier 2015-02-10 15:13:31 +01:00
parent 90afddbdc8
commit 5fae142bbc
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}