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 <tom@tsou.cc>
This commit is contained in:
Thomas Tsou 2013-11-15 23:00:28 -05:00
parent 85b179d125
commit 2c79110969
1 changed files with 4 additions and 1 deletions

View File

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