bugfix: ShowMessage dialog could crash if custom font was used (fixes #1591)

This commit is contained in:
Dimitris Panokostas 2025-01-12 15:07:45 +01:00
parent 6494832ff1
commit 69c11f909d
No known key found for this signature in database
GPG Key ID: 330156A68E9E0929

View File

@ -186,20 +186,8 @@ static void InitShowMessage(const std::string& message)
{
TTF_Init();
try
{
gui_font = new gcn::SDLTrueTypeFont(prefix_with_data_path(gui_theme.font_name), gui_theme.font_size);
gui_font->setAntiAlias(false);
gui_font->setColor(gui_font_color);
}
catch (exception& ex)
{
cout << ex.what() << '\n';
write_log("An error occurred while trying to open the GUI font! Exception: %s\n", ex.what());
abort();
}
gcn::Widget::setGlobalFont(gui_font);
load_theme(amiberry_options.gui_theme);
apply_theme();
}
wndShowMessage = new gcn::Window("Message");