From 60ac622245a04e83302db866cf9244f1b71b62dd Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 13 Jun 2018 14:33:51 -0700 Subject: screen_ui: Call gr_exit() from dtor. ScreenRecoveryUI calls gr_init() during Init(), and should release any allocated resource upon destructing. It's a no-op to call gr_exit() if gr_init() was not called or didn't finish successfully. Test: recovery_unit_test on marlin. Test: Boot into recovery. Run graphics test. Change-Id: Ib9632170174cdacd51d382f23c8daf6a9bc59f7a --- screen_ui.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/screen_ui.cpp b/screen_ui.cpp index b4ef054ce..e8444b6ca 100644 --- a/screen_ui.cpp +++ b/screen_ui.cpp @@ -176,6 +176,8 @@ ScreenRecoveryUI::~ScreenRecoveryUI() { if (progress_thread_.joinable()) { progress_thread_.join(); } + // No-op if gr_init() (via Init()) was not called or had failed. + gr_exit(); } GRSurface* ScreenRecoveryUI::GetCurrentFrame() const { -- cgit v1.2.3