Skip to content

Commit 81b9c02

Browse files
kahrlZeno-
authored andcommittedFeb 17, 2015
Grab GUIChatConsole::m_font, fixes segfault when changing font_size
1 parent fd70f4f commit 81b9c02

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

Diff for: ‎src/guiChatConsole.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ GUIChatConsole::GUIChatConsole(
9999
{
100100
core::dimension2d<u32> dim = m_font->getDimension(L"M");
101101
m_fontsize = v2u32(dim.Width, dim.Height);
102-
dstream << "Font size: " << m_fontsize.X << " " << m_fontsize.Y << std::endl;
102+
m_font->grab();
103103
}
104104
m_fontsize.X = MYMAX(m_fontsize.X, 1);
105105
m_fontsize.Y = MYMAX(m_fontsize.Y, 1);
@@ -109,7 +109,10 @@ GUIChatConsole::GUIChatConsole(
109109
}
110110

111111
GUIChatConsole::~GUIChatConsole()
112-
{}
112+
{
113+
if (m_font)
114+
m_font->drop();
115+
}
113116

114117
void GUIChatConsole::openConsole(f32 height)
115118
{

0 commit comments

Comments
 (0)