aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2015-02-17 10:29:44 +0100
committerCraig Robbins <kde.psych@gmail.com>2015-02-18 00:38:57 +1000
commit81b9c023c4f96d2db06706496e0578fdd1b6377b (patch)
tree2b402dd8deb430c98e37aeaa5f5faab54ea5fb36 /src
parentfd70f4f2f040b64064676706e41d6da90c2b00db (diff)
downloadminetest-81b9c023c4f96d2db06706496e0578fdd1b6377b.tar.gz
minetest-81b9c023c4f96d2db06706496e0578fdd1b6377b.tar.bz2
minetest-81b9c023c4f96d2db06706496e0578fdd1b6377b.zip
Grab GUIChatConsole::m_font, fixes segfault when changing font_size
Diffstat (limited to 'src')
-rw-r--r--src/guiChatConsole.cpp7
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)
{