Author: jmorlan
Date: Tue Jul 15 19:24:54 2008
New Revision: 34539
URL:
http://svn.reactos.org/svn/reactos?rev=34539&view=rev
Log:
Increment a console's initial screen buffer's reference count *after* calling
CsrInitConsoleScreenBuffer (which sets the reference count to 0). Fixes bug 3524.
Modified:
trunk/reactos/subsystems/win32/csrss/win32csr/conio.c
Modified: trunk/reactos/subsystems/win32/csrss/win32csr/conio.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/csrss/win…
==============================================================================
--- trunk/reactos/subsystems/win32/csrss/win32csr/conio.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/csrss/win32csr/conio.c [iso-8859-1] Tue Jul 15 19:24:54
2008
@@ -191,9 +191,6 @@
/* 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)
{
@@ -229,6 +226,9 @@
DPRINT1("CsrInitConsoleScreenBuffer: failed\n");
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);