From 2c7911096991648ca2be73b9abfafb5c937177a0 Mon Sep 17 00:00:00 2001 From: Thomas Tsou Date: Fri, 15 Nov 2013 23:00:28 -0500 Subject: Transceiver52M: UHD: Check running status before stopping stream On startup errors we get a segfault if we stop and shutdown. This is because we try to send a stop stream command to the device before it has been created. Setup a check for running status before attempting to stop the physical device. Signed-off-by: Thomas Tsou --- Transceiver52M/UHDDevice.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index 6275cb2..7781838 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -756,7 +756,10 @@ bool uhd_device::start() bool uhd_device::stop() { - uhd::stream_cmd_t stream_cmd = + if (!started) + return false; + + uhd::stream_cmd_t stream_cmd = uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS; usrp_dev->issue_stream_cmd(stream_cmd); -- cgit v1.2.3