- Fix exceptions in some cases (if CriticalSection->DebugInfo = NULL)

svn path=/trunk/; revision=39891
This commit is contained in:
Dmitry Chapyshev 2009-03-06 18:03:04 +00:00
parent 79c11338fa
commit 64455e3b04

View file

@ -358,14 +358,21 @@ RtlDeleteCriticalSection(PRTL_CRITICAL_SECTION CriticalSection)
/* Protect List */ /* Protect List */
RtlEnterCriticalSection(&RtlCriticalSectionLock); RtlEnterCriticalSection(&RtlCriticalSectionLock);
/* Remove it from the list */ if (CriticalSection->DebugInfo)
RemoveEntryList(&CriticalSection->DebugInfo->ProcessLocksList); {
/* Remove it from the list */
RemoveEntryList(&CriticalSection->DebugInfo->ProcessLocksList);
RtlZeroMemory(CriticalSection->DebugInfo, sizeof(RTL_CRITICAL_SECTION_DEBUG));
}
/* Unprotect */ /* Unprotect */
RtlLeaveCriticalSection(&RtlCriticalSectionLock); RtlLeaveCriticalSection(&RtlCriticalSectionLock);
/* Free it */ if (CriticalSection->DebugInfo)
RtlpFreeDebugInfo(CriticalSection->DebugInfo); {
/* Free it */
RtlpFreeDebugInfo(CriticalSection->DebugInfo);
}
/* Wipe it out */ /* Wipe it out */
RtlZeroMemory(CriticalSection, sizeof(RTL_CRITICAL_SECTION)); RtlZeroMemory(CriticalSection, sizeof(RTL_CRITICAL_SECTION));