From 9606e66b15152f96ecaa22b625b5dfad58c507db Mon Sep 17 00:00:00 2001 From: cathery Date: Fri, 24 Sep 2021 18:40:31 +0300 Subject: [PATCH] Fix incorrect cleanup when handling ams:bpc and sm sessions --- source/gui/gui_hekate.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/gui/gui_hekate.cpp b/source/gui/gui_hekate.cpp index 6d83fd8..c52e350 100644 --- a/source/gui/gui_hekate.cpp +++ b/source/gui/gui_hekate.cpp @@ -62,12 +62,10 @@ GuiHekate::GuiHekate() : Gui() { } if (canReboot) { - smExit(); //Required to connect to ams:bpc (is it?) + smExit(); //Required to connect to ams:bpc if R_FAILED(rc = amsBpcInitialize()) { canReboot = false; errorMessage = "Failed to initialize ams:bpc!"; - } - else { smInitialize(); } } @@ -163,6 +161,9 @@ GuiHekate::GuiHekate() : Gui() { GuiHekate::~GuiHekate() { amsBpcExit(); + if(canReboot) { + smInitialize(); + } setsysExit(); spsmExit(); }