--- trunk/reactos/lib/kernel32/misc/dllmain.c 2005-08-16 23:05:33 UTC (rev 17417)
+++ trunk/reactos/lib/kernel32/misc/dllmain.c 2005-08-16 23:37:17 UTC (rev 17418)
@@ -26,6 +26,7 @@
HANDLE hBaseDir = NULL;
static BOOL DllInitialized = FALSE;
+static BOOL ConsoleInitialized = FALSE;
BOOL STDCALL
DllMain(HANDLE hInst,
@@ -141,6 +142,7 @@
}
/* Initialize Console Ctrl Handler */
+ ConsoleInitialized = TRUE;
RtlInitializeCriticalSection(&ConsoleLock);
SetConsoleCtrlHandler(DefaultConsoleCtrlHandler, TRUE);
@@ -289,7 +291,10 @@
NlsUninit();
/* Delete DLL critical section */
- RtlDeleteCriticalSection (&ConsoleLock);
+ if (ConsoleInitialized == TRUE)
+ {
+ RtlDeleteCriticalSection (&ConsoleLock);
+ }
RtlDeleteCriticalSection (&DllLock);
/* Close object base directory */