summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2018-12-31 00:00:29 +0100
committerglx22 <glx22@users.noreply.github.com>2019-01-05 18:10:14 +0100
commit92d3358db551ac9d98064219ec64404a74764ce2 (patch)
treea18339a69dcf887bc3079dcadcca2e6220e2a9d8
parent4fbfe34e3697b4275212d9e569d05af398552fda (diff)
downloadopenttd-92d3358db551ac9d98064219ec64404a74764ce2.tar.xz
Fix: [Win32] don't mess with std[out|err|in] if we can't allocate a console
-rw-r--r--src/os/windows/win32.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/os/windows/win32.cpp b/src/os/windows/win32.cpp
index d2540ac34..bb1a0a420 100644
--- a/src/os/windows/win32.cpp
+++ b/src/os/windows/win32.cpp
@@ -300,7 +300,7 @@ void CreateConsole()
if (_has_console) return;
_has_console = true;
- AllocConsole();
+ if (!AllocConsole()) return;
hand = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hand, &coninfo);