From 94371fd012c661859326b73246b781ae872e0871 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 6 Jun 2018 07:38:54 -0700 Subject: ui: join only if joinable. The threads in RecoveryUI only get initialized if their Init()s finish successfully. Test: recovery_unit_test on marlin. Change-Id: Ic4b62300a3cbd47887d9f4a90dc26f8a7deab616 --- ui.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ui.cpp') diff --git a/ui.cpp b/ui.cpp index 51d7f129c..6c91d01b8 100644 --- a/ui.cpp +++ b/ui.cpp @@ -78,7 +78,9 @@ RecoveryUI::RecoveryUI() RecoveryUI::~RecoveryUI() { ev_exit(); input_thread_stopped_ = true; - input_thread_.join(); + if (input_thread_.joinable()) { + input_thread_.join(); + } } void RecoveryUI::OnKeyDetected(int key_code) { -- cgit v1.2.3