mirror of
https://github.com/minetest/minetest.git
synced 2024-12-28 08:57:30 +01:00
Grab GUIChatConsole::m_font, fixes segfault when changing font_size
This commit is contained in:
parent
fd70f4f2f0
commit
81b9c023c4
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user