From: thedax Date: Mon, 9 Nov 2015 21:31:31 +0000 (-0500) Subject: Pretty sure it's not a good idea to decrement a handle. X-Git-Tag: v1.0.0~43^2 X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=67a138456479327b16f5f919eefa3cef119acf25;p=corbenik%2Fctrulib.git Pretty sure it's not a good idea to decrement a handle. --- diff --git a/libctru/source/services/ptm.c b/libctru/source/services/ptm.c index a986d2f..dc0ccc3 100644 --- a/libctru/source/services/ptm.c +++ b/libctru/source/services/ptm.c @@ -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); }