Everything works fine now :)

This commit is contained in:
XorTroll 2019-12-18 20:45:44 +01:00
parent 4e3bc5b2cb
commit 1f0b9782de
3 changed files with 32 additions and 6 deletions

View file

@ -7,12 +7,9 @@ namespace am
bool LibraryAppletIsActive()
{
bool active = false;
if(applet_holder.StateChangedEvent.revent == INVALID_HANDLE) active = false;
if(!serviceIsActive(&applet_holder.s)) active = false;
active = !appletHolderCheckFinished(&applet_holder);
if(!active) appletUpdateCallerAppletCaptureImage();
return active;
if(applet_holder.StateChangedEvent.revent == INVALID_HANDLE) return false;
if(!serviceIsActive(&applet_holder.s)) return false;
return !appletHolderCheckFinished(&applet_holder);
}
bool LibraryAppletIsQMenu()

View file

@ -0,0 +1,26 @@
#include <q_Include.hpp>
extern "C"
{
void __appExit(void);
void NORETURN __nx_exit(Result rc, LoaderReturnFn retaddr);
void NORETURN __libnx_exit(int rc)
{
// Call destructors.
void __libc_fini_array(void);
__libc_fini_array();
// Clean up services.
__appExit();
// 3.0.0 libnx fucked up _appletExitProcess() process-exiting call, and fixed it in later commits.
// Adding this manually until a new version is released with the fix, then this will be removed.
// Explicitly initialize applet again, since applet-based exiting needs this, and since it isn't added in 3.0.0, we wrap it here
// TODO: remove this when next libnx releases
appletInitialize();
__nx_exit(0, envGetExitFuncPtr());
}
}

View file

@ -55,6 +55,9 @@ namespace qmenu
net::Finalize();
nsExit();
accountExit();
// Explicitly call appletExit (due to bad handling in 3.0.0 libnx)
appletExit();
}
}