From 191675bf31771553564c15f97f820b60d9cb3280 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sat, 9 Nov 2019 19:11:01 +0300 Subject: [PATCH] Remove gsl::finally only use --- rpcs3/Emu/Cell/PPUThread.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index 6c2163f117..7b2b17aaa9 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -839,7 +839,7 @@ void ppu_thread::fast_call(u32 addr, u32 rtoc) return fmt::format("%s [0x%08x]", thread_ctrl::get_name(), _this->cia); }; - auto at_ret = gsl::finally([&]() + auto at_ret = [&]() { if (std::uncaught_exceptions()) { @@ -866,9 +866,19 @@ void ppu_thread::fast_call(u32 addr, u32 rtoc) current_function = old_func; g_tls_log_prefix = old_fmt; } - }); + }; - exec_task(); + try + { + exec_task(); + } + catch (...) + { + at_ret(); + throw; + } + + at_ret(); } u32 ppu_thread::stack_push(u32 size, u32 align_v)