From dc4ada2bfd5d9f4386661ffbf7ff3ad000b6bfb5 Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Tue, 6 Jun 2017 19:46:00 +0200 Subject: [PATCH] Fix #775 by catching and handling the thrown exception --- pv/session.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pv/session.cpp b/pv/session.cpp index eec1a051..c18f8094 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -849,7 +849,14 @@ void Session::sample_thread_proc(function error_handler) set_capture_state(device_->session()->trigger() ? AwaitingTrigger : Running); - device_->run(); + try { + device_->run(); + } catch (Error e) { + error_handler(e.what()); + set_capture_state(Stopped); + return; + } + set_capture_state(Stopped); // Confirm that SR_DF_END was received -- 2.30.2