Commit c262fee2 authored by Michael Natterer's avatar Michael Natterer 😴

Bug 689523 - GIMP crashes (segfault) when loading a context with a font...

Make gimp_context_get|set_font_name() actually deal with
context->font_name, so the context can do its job of keeping the name
of an unavailable object around.
parent 0a37a049
......@@ -3228,7 +3228,7 @@ gimp_context_get_font_name (GimpContext *context)
{
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
return (context->font ? gimp_object_get_name (context->font) : NULL);
return context->font_name;
}
void
......@@ -3241,7 +3241,20 @@ gimp_context_set_font_name (GimpContext *context,
font = gimp_container_get_child_by_name (context->gimp->fonts, name);
gimp_context_set_font (context, GIMP_FONT (font));
if (font)
{
gimp_context_set_font (context, GIMP_FONT (font));
}
else
{
/* No font with this name exists, use the standard font, but
* keep the intended name around
*/
gimp_context_set_font (context, gimp_font_get_standard ());
g_free (context->font_name);
context->font_name = g_strdup (name);
}
}
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment