diff options
author | Kahrl <kahrl@gmx.net> | 2015-02-17 10:29:44 +0100 |
---|---|---|
committer | Craig Robbins <kde.psych@gmail.com> | 2015-02-18 00:40:11 +1000 |
commit | 4875213168ed877ab708e81d539923109977a5c8 (patch) | |
tree | 702750bcf2bc4ba695b5d67d2fd03daf059e4fc0 | |
parent | f92540e8adf70f09fa400d0b2abf97ef762b0759 (diff) | |
download | minetest-4875213168ed877ab708e81d539923109977a5c8.tar.gz minetest-4875213168ed877ab708e81d539923109977a5c8.tar.bz2 minetest-4875213168ed877ab708e81d539923109977a5c8.zip |
Grab GUIChatConsole::m_font, fixes segfault when changing font_size
-rw-r--r-- | src/guiChatConsole.cpp | 7 |
1 files 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<u32> 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) { |