- 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 */
RtlEnterCriticalSection(&RtlCriticalSectionLock);
/* Remove it from the list */
RemoveEntryList(&CriticalSection->DebugInfo->ProcessLocksList);
if (CriticalSection->DebugInfo)
{
/* Remove it from the list */
RemoveEntryList(&CriticalSection->DebugInfo->ProcessLocksList);
RtlZeroMemory(CriticalSection->DebugInfo, sizeof(RTL_CRITICAL_SECTION_DEBUG));
}
/* Unprotect */
RtlLeaveCriticalSection(&RtlCriticalSectionLock);
/* Free it */
RtlpFreeDebugInfo(CriticalSection->DebugInfo);
if (CriticalSection->DebugInfo)
{
/* Free it */
RtlpFreeDebugInfo(CriticalSection->DebugInfo);
}
/* Wipe it out */
RtlZeroMemory(CriticalSection, sizeof(RTL_CRITICAL_SECTION));