summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libw32c.cc
diff options
context:
space:
mode:
authorSamuel Bronson <naesten@gmail.com>2011-12-10 21:37:10 -0500
committerSamuel Bronson <naesten@gmail.com>2011-12-10 23:00:01 -0500
commit4b63a8fcd224c9b59d0b0d15c9d92fc41b7754bc (patch)
tree2c8e5adbfd52e74facb92f3b20b34a49c1b28374 /crawl-ref/source/libw32c.cc
parent8e847cfab6c21fc84076063e372aac9372241b87 (diff)
downloadcrawl-ref-4b63a8fcd224c9b59d0b0d15c9d92fc41b7754bc.tar.gz
crawl-ref-4b63a8fcd224c9b59d0b0d15c9d92fc41b7754bc.zip
Windows console: Add a few missing steps to console shutdown
Diffstat (limited to 'crawl-ref/source/libw32c.cc')
-rw-r--r--crawl-ref/source/libw32c.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/crawl-ref/source/libw32c.cc b/crawl-ref/source/libw32c.cc
index 7ab8759688..1cda0df8da 100644
--- a/crawl-ref/source/libw32c.cc
+++ b/crawl-ref/source/libw32c.cc
@@ -403,7 +403,7 @@ void console_startup()
void console_shutdown()
{
// don't do anything if we were never initted
- if (inbuf == NULL || outbuf == NULL)
+ if (inbuf == NULL && outbuf == NULL && old_outbuf == NULL)
return;
// JWM, 06/12/2004: Code page stuff. If it was the preferred code page, it
@@ -421,6 +421,8 @@ void console_shutdown()
_setcursortype_internal(true);
textcolor(DARKGREY);
+ inbuf = NULL;
+
delete [] screen;
screen = NULL;
@@ -434,6 +436,7 @@ void console_shutdown()
SetConsoleActiveScreenBuffer(old_outbuf);
CloseHandle(outbuf);
old_outbuf = 0;
+ outbuf = 0;
}
}