mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
Only init/exit apm from applet with AppletType_Application. Closes #360.
This commit is contained in:
parent
f043307e7f
commit
1bb1aef2f7
@ -21,10 +21,10 @@ typedef enum {
|
||||
ApmCpuBoostMode_Type2 = 2, ///< Use performance configurations 0x9222000B and 0x9222000C.
|
||||
} ApmCpuBoostMode;
|
||||
|
||||
/// Initialize apm. Used automatically by \ref appletInitialize.
|
||||
/// Initialize apm. Used automatically by \ref appletInitialize with AppletType_Application.
|
||||
Result apmInitialize(void);
|
||||
|
||||
/// Exit apm. Used automatically by \ref appletExit.
|
||||
/// Exit apm. Used automatically by \ref appletExit with AppletType_Application.
|
||||
void apmExit(void);
|
||||
|
||||
/// Gets the Service object for the actual apm service session.
|
||||
|
@ -118,8 +118,10 @@ Result _appletInitialize(void) {
|
||||
if (__nx_applet_type == AppletType_None)
|
||||
return 0;
|
||||
|
||||
if (__nx_applet_type == AppletType_Default || __nx_applet_type == AppletType_Application) {
|
||||
if (R_FAILED(apmInitialize()))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_ApmFailedToInitialize);
|
||||
}
|
||||
|
||||
Result rc = 0;
|
||||
|
||||
@ -422,8 +424,6 @@ void _appletCleanup(void) {
|
||||
serviceClose(&g_appletSrv);
|
||||
g_appletResourceUserId = 0;
|
||||
|
||||
apmExit();
|
||||
|
||||
if (g_appletRecordingInitialized > 0) {
|
||||
tmemClose(&g_appletRecordingTmem);
|
||||
g_appletRecordingInitialized = 0;
|
||||
@ -433,6 +433,8 @@ void _appletCleanup(void) {
|
||||
tmemClose(&g_appletCopyrightTmem);
|
||||
g_appletCopyrightInitialized = 0;
|
||||
}
|
||||
|
||||
if (_appletIsRegularApplication()) apmExit();
|
||||
}
|
||||
|
||||
Service* appletGetServiceSession_Proxy(void) {
|
||||
|
Loading…
Reference in New Issue
Block a user