Author: dchapyshev Date: Fri Mar 6 21:03:04 2009 New Revision: 39891
URL: http://svn.reactos.org/svn/reactos?rev=39891&view=rev Log: - Fix exceptions in some cases (if CriticalSection->DebugInfo = NULL)
Modified: trunk/reactos/lib/rtl/critical.c
Modified: trunk/reactos/lib/rtl/critical.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/critical.c?rev=3989... ============================================================================== --- trunk/reactos/lib/rtl/critical.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/critical.c [iso-8859-1] Fri Mar 6 21:03:04 2009 @@ -358,14 +358,21 @@ /* 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));