mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
CoreTemp: Fixed mutex handle leak.
This commit is contained in:
parent
a2316446ca
commit
6c36a662e5
@ -32,15 +32,17 @@ bool CSharedMemClient::ReadSharedMem(PCORE_TEMP_SHARED_DATA i_SharedData)
|
|||||||
if (hdlMemory == NULL)
|
if (hdlMemory == NULL)
|
||||||
{
|
{
|
||||||
ReleaseMutex(hdlMutex);
|
ReleaseMutex(hdlMutex);
|
||||||
|
CloseHandle(hdlMutex);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
pSharedData = (PCORE_TEMP_SHARED_DATA)MapViewOfFile(hdlMemory, FILE_MAP_READ, 0, 0, 0);
|
pSharedData = (PCORE_TEMP_SHARED_DATA)MapViewOfFile(hdlMemory, FILE_MAP_READ, 0, 0, 0);
|
||||||
if (pSharedData == NULL)
|
if (pSharedData == NULL)
|
||||||
{
|
{
|
||||||
ReleaseMutex(hdlMutex);
|
|
||||||
CloseHandle(hdlMemory);
|
CloseHandle(hdlMemory);
|
||||||
hdlMemory = NULL;
|
hdlMemory = NULL;
|
||||||
|
ReleaseMutex(hdlMutex);
|
||||||
|
CloseHandle(hdlMutex);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,6 +60,7 @@ bool CSharedMemClient::ReadSharedMem(PCORE_TEMP_SHARED_DATA i_SharedData)
|
|||||||
UnmapViewOfFile(pSharedData);
|
UnmapViewOfFile(pSharedData);
|
||||||
CloseHandle(hdlMemory);
|
CloseHandle(hdlMemory);
|
||||||
ReleaseMutex(hdlMutex);
|
ReleaseMutex(hdlMutex);
|
||||||
|
CloseHandle(hdlMutex);
|
||||||
|
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user