1
0

Fixed a bug in LeakFinder.

This commit is contained in:
madmaxoft 2014-01-23 17:54:38 +01:00
parent 34f13d589a
commit 9774da8122

View File

@ -862,8 +862,10 @@ static int MyAllocHook(int nAllocType, void *pvData,
{ {
// RequestID was found // RequestID was found
size_t temp = g_CurrentMemUsage; size_t temp = g_CurrentMemUsage;
g_CurrentMemUsage -= nSize ; if (g_pCRTTable->Remove(lRequest))
g_pCRTTable->Remove(lRequest); {
g_CurrentMemUsage -= nSize;
}
if (g_CurrentMemUsage > temp) if (g_CurrentMemUsage > temp)
{ {
printf("********************************************\n"); printf("********************************************\n");
@ -896,8 +898,11 @@ static int MyAllocHook(int nAllocType, void *pvData,
// Try to find the RequestID in the Hash-Table, mark it that it was freed // Try to find the RequestID in the Hash-Table, mark it that it was freed
lReallocRequest = pHead->lRequest; lReallocRequest = pHead->lRequest;
size_t temp = g_CurrentMemUsage; size_t temp = g_CurrentMemUsage;
g_CurrentMemUsage -= pHead->nDataSize;
bRet = g_pCRTTable->Remove(lReallocRequest); bRet = g_pCRTTable->Remove(lReallocRequest);
if (bRet)
{
g_CurrentMemUsage -= pHead->nDataSize;
}
if (g_CurrentMemUsage > temp) if (g_CurrentMemUsage > temp)
{ {
printf("********************************************\n"); printf("********************************************\n");