Skip to content

Commit

Permalink
Grab GUIChatConsole::m_font, fixes segfault when changing font_size
Browse files Browse the repository at this point in the history
  • Loading branch information
kahrl authored and Zeno- committed Feb 17, 2015
1 parent fd70f4f commit 81b9c02
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/guiChatConsole.cpp
Expand Up @@ -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);
Expand All @@ -109,7 +109,10 @@ GUIChatConsole::GUIChatConsole(
}

GUIChatConsole::~GUIChatConsole()
{}
{
if (m_font)
m_font->drop();
}

void GUIChatConsole::openConsole(f32 height)
{
Expand Down

0 comments on commit 81b9c02

Please sign in to comment.