Fix incorrect cleanup when handling ams:bpc and sm sessions

This commit is contained in:
cathery 2021-09-24 18:40:31 +03:00
parent e0fc1ff00b
commit 9606e66b15

View File

@ -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();
}