Pretty sure it's not a good idea to decrement a handle.
This commit is contained in:
parent
c12c0aace3
commit
67a1384564
@ -28,13 +28,13 @@ Result ptmSysmInit(void)
|
|||||||
{
|
{
|
||||||
if (AtomicPostIncrement(&ptmSysmRefCount)) return 0;
|
if (AtomicPostIncrement(&ptmSysmRefCount)) return 0;
|
||||||
Result res = srvGetServiceHandle(&ptmSysmHandle, "ptm:sysm");
|
Result res = srvGetServiceHandle(&ptmSysmHandle, "ptm:sysm");
|
||||||
if (R_FAILED(res)) AtomicDecrement(&ptmSysmHandle);
|
if (R_FAILED(res)) AtomicDecrement(&ptmSysmRefCount);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ptmSysmExit(void)
|
void ptmSysmExit(void)
|
||||||
{
|
{
|
||||||
if (AtomicDecrement(&ptmSysmHandle)) return;
|
if (AtomicDecrement(&ptmSysmRefCount)) return;
|
||||||
svcCloseHandle(ptmSysmHandle);
|
svcCloseHandle(ptmSysmHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user