From: Joel Holdsworth Date: Thu, 29 May 2014 22:22:52 +0000 (+0100) Subject: SigSession: Fixed std::thread joining X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=commitdiff_plain;h=04463625a6df63c87e445e9950260d4ecc95a79e SigSession: Fixed std::thread joining --- diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index 87b561e..e42ba2c 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -77,11 +77,9 @@ SigSession::~SigSession() { using pv::device::Device; + // Stop and join to the thread stop_capture(); - if (_sampling_thread.joinable()) - _sampling_thread.join(); - _dev_inst->release(); // TODO: This should not be necessary @@ -195,10 +193,8 @@ void SigSession::start_capture(function error_handler) void SigSession::stop_capture() { - if (get_capture_state() == Stopped) - return; - - sr_session_stop(); + if (get_capture_state() != Stopped) + sr_session_stop(); // Check that sampling stopped if (_sampling_thread.joinable())