From 4875213168ed877ab708e81d539923109977a5c8 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Tue, 17 Feb 2015 10:29:44 +0100 Subject: [PATCH] Grab GUIChatConsole::m_font, fixes segfault when changing font_size --- src/guiChatConsole.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/guiChatConsole.cpp b/src/guiChatConsole.cpp index bdce7c872..8210e0bf4 100644 --- a/src/guiChatConsole.cpp +++ b/src/guiChatConsole.cpp @@ -99,7 +99,7 @@ GUIChatConsole::GUIChatConsole( { core::dimension2d dim = m_font->getDimension(L"M"); m_fontsize = v2u32(dim.Width, dim.Height); - dstream << "Font size: " << m_fontsize.X << " " << m_fontsize.Y << std::endl; + m_font->grab(); } m_fontsize.X = MYMAX(m_fontsize.X, 1); m_fontsize.Y = MYMAX(m_fontsize.Y, 1); @@ -109,7 +109,10 @@ GUIChatConsole::GUIChatConsole( } GUIChatConsole::~GUIChatConsole() -{} +{ + if (m_font) + m_font->drop(); +} void GUIChatConsole::openConsole(f32 height) {