Increment a console's initial screen buffer's reference count *after* calling CsrInitConsoleScreenBuffer (which sets the reference count to 0). Fixes bug 3524.

svn path=/trunk/; revision=34539
This commit is contained in:
Jeffrey Morlan 2008-07-16 00:24:54 +00:00
parent 0f5230d382
commit 44e8888c47

View file

@ -191,9 +191,6 @@ CsrInitConsole(PCSRSS_CONSOLE Console)
/* make console active, and insert into console list */
Console->ActiveBuffer = (PCSRSS_SCREEN_BUFFER) NewBuffer;
Console->hActiveBuffer = INVALID_HANDLE_VALUE;
/* add a reference count because the buffer is tied to the console */
InterlockedIncrement(&Console->ActiveBuffer->Header.ReferenceCount);
if (! GuiMode)
{
@ -230,6 +227,9 @@ CsrInitConsole(PCSRSS_CONSOLE Console)
return Status;
}
/* add a reference count because the buffer is tied to the console */
InterlockedIncrement(&Console->ActiveBuffer->Header.ReferenceCount);
/* copy buffer contents to screen */
ConioDrawConsole(Console);