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
diff --git a/screen_ui.cpp b/screen_ui.cpp
index b9aba80..b4ef054 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -173,7 +173,9 @@
ScreenRecoveryUI::~ScreenRecoveryUI() {
progress_thread_stopped_ = true;
- progress_thread_.join();
+ if (progress_thread_.joinable()) {
+ progress_thread_.join();
+ }
}
GRSurface* ScreenRecoveryUI::GetCurrentFrame() const {