Merge pull request #214 from thedax/great-refactor-fix
Pretty sure it's not a good idea to decrement a handle.
This commit is contained in:
commit
9c98fe54b1
@ -28,13 +28,13 @@ Result ptmSysmInit(void)
|
||||
{
|
||||
if (AtomicPostIncrement(&ptmSysmRefCount)) return 0;
|
||||
Result res = srvGetServiceHandle(&ptmSysmHandle, "ptm:sysm");
|
||||
if (R_FAILED(res)) AtomicDecrement(&ptmSysmHandle);
|
||||
if (R_FAILED(res)) AtomicDecrement(&ptmSysmRefCount);
|
||||
return res;
|
||||
}
|
||||
|
||||
void ptmSysmExit(void)
|
||||
{
|
||||
if (AtomicDecrement(&ptmSysmHandle)) return;
|
||||
if (AtomicDecrement(&ptmSysmRefCount)) return;
|
||||
svcCloseHandle(ptmSysmHandle);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user