mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 13:02:38 +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_Type2 = 2, ///< Use performance configurations 0x9222000B and 0x9222000C.
|
||||||
} ApmCpuBoostMode;
|
} ApmCpuBoostMode;
|
||||||
|
|
||||||
/// Initialize apm. Used automatically by \ref appletInitialize.
|
/// Initialize apm. Used automatically by \ref appletInitialize with AppletType_Application.
|
||||||
Result apmInitialize(void);
|
Result apmInitialize(void);
|
||||||
|
|
||||||
/// Exit apm. Used automatically by \ref appletExit.
|
/// Exit apm. Used automatically by \ref appletExit with AppletType_Application.
|
||||||
void apmExit(void);
|
void apmExit(void);
|
||||||
|
|
||||||
/// Gets the Service object for the actual apm service session.
|
/// Gets the Service object for the actual apm service session.
|
||||||
|
@ -118,8 +118,10 @@ Result _appletInitialize(void) {
|
|||||||
if (__nx_applet_type == AppletType_None)
|
if (__nx_applet_type == AppletType_None)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (R_FAILED(apmInitialize()))
|
if (__nx_applet_type == AppletType_Default || __nx_applet_type == AppletType_Application) {
|
||||||
return MAKERESULT(Module_Libnx, LibnxError_ApmFailedToInitialize);
|
if (R_FAILED(apmInitialize()))
|
||||||
|
return MAKERESULT(Module_Libnx, LibnxError_ApmFailedToInitialize);
|
||||||
|
}
|
||||||
|
|
||||||
Result rc = 0;
|
Result rc = 0;
|
||||||
|
|
||||||
@ -422,8 +424,6 @@ void _appletCleanup(void) {
|
|||||||
serviceClose(&g_appletSrv);
|
serviceClose(&g_appletSrv);
|
||||||
g_appletResourceUserId = 0;
|
g_appletResourceUserId = 0;
|
||||||
|
|
||||||
apmExit();
|
|
||||||
|
|
||||||
if (g_appletRecordingInitialized > 0) {
|
if (g_appletRecordingInitialized > 0) {
|
||||||
tmemClose(&g_appletRecordingTmem);
|
tmemClose(&g_appletRecordingTmem);
|
||||||
g_appletRecordingInitialized = 0;
|
g_appletRecordingInitialized = 0;
|
||||||
@ -433,6 +433,8 @@ void _appletCleanup(void) {
|
|||||||
tmemClose(&g_appletCopyrightTmem);
|
tmemClose(&g_appletCopyrightTmem);
|
||||||
g_appletCopyrightInitialized = 0;
|
g_appletCopyrightInitialized = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_appletIsRegularApplication()) apmExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
Service* appletGetServiceSession_Proxy(void) {
|
Service* appletGetServiceSession_Proxy(void) {
|
||||||
|
Loading…
Reference in New Issue
Block a user