From c88bea169adaf492d7e1da6567edee6f9b6a94d1 Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Tue, 26 Aug 2014 12:44:17 +0200 Subject: [PATCH] Added ugly workaround for Console crash at startup This is an ugly workaround for a crash at startup. Console::current() becomes valid before the Console constructor is finished and loading Surfaces and Fonts wants to write text to the Console, with Fonts that aren't yet loaded, thus crashing --- src/supertux/console.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/supertux/console.cpp b/src/supertux/console.cpp index 9f1726764..71b0c5fc6 100644 --- a/src/supertux/console.cpp +++ b/src/supertux/console.cpp @@ -123,6 +123,16 @@ Console::~Console() void Console::on_buffer_change(int line_count) { + if (!m_font) + { + // FIXME: This is an ugly workaround for a crash at startup. + // Console::current() becomes valid before the Console constructor + // is finished and loading Surfaces and Fonts wants to write text + // to the Console, with Fonts that aren't yet loaded, thus + // crashing + return; + } + // increase console height if necessary if (m_stayOpen > 0 && m_height < 64) { -- 2.11.0