reopen 369445
tags = patch
thanks, control just let's keep my stupid mistake amongst us, ok?
On Thu, Aug 24, 2006 at 08:33:14PM -0300, Damián Viano wrote:
Perfect, with your instructions I could reproduce and fix this bug. I
didn't need to dig so much on who was using the NULL pointer returned
by gdk_font_load, since the right fix imho is to avoid overriding the
right font in case of not finding the new font appropriate. So this would
just use the default font in the gtk theme if the setted font can't be
loaded.
Sory, I made a *stupid* mistake, in that the font gets unref'ed even if
it's not changed. This would probably throw the same error than before,
just not so soon, efectivly hidding the bug! Do I rock or what?
Anyway, here's a decent patch, on the house ;-P
--
Damián Viano(Des) ¯ ¯ - _ _ - ¯ ¯
GPG: 0x6EB95A6F Debian ¯-_GNU_-¯ Linux
Web: http://damianv.com.ar/ ¯-¯
diff -Nura gmoo-0.5.6.des/src/settings.c gmoo-0.5.6/src/settings.c
--- gmoo-0.5.6.des/src/settings.c 2006-08-25 10:27:35.0 +
+++ gmoo-0.5.6/src/settings.c 2006-08-24 23:23:43.0 +
@@ -254,7 +254,6 @@
gushort r[N_COLORS];
gushort g[N_COLORS];
gushort b[N_COLORS];
-GdkFont* new_font;
int i;
settings_get_rgbs(r, g, b);
@@ -266,11 +265,8 @@
copy_color(input_style-text[GTK_STATE_NORMAL], colors[FG_COLOR]);
copy_color(input_style-base[GTK_STATE_NORMAL], colors[BG_COLOR]);
-new_font = gdk_font_load(settings-fontname);
-if (new_font) {
-gdk_font_unref(input_style-font);
-input_style-font = new_font;
- }
+gdk_font_unref(input_style-font);
+input_style-font = gdk_font_load(settings-fontname);
}
void init_colors_and_styles() {