Mercurial > audlegacy
changeset 4158:ce8f5c9c0869
Crash on font changing
author | Eugene Zagidullin <e.asphyx@gmail.com> |
---|---|
date | Wed, 09 Jan 2008 23:37:16 +0300 |
parents | ae231a103173 |
children | 65bb64b7747e |
files | src/audacious/ui_playlist.c src/audacious/ui_preferences.c |
diffstat | 2 files changed, 12 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/audacious/ui_playlist.c Fri Jan 04 14:42:13 2008 +0100 +++ b/src/audacious/ui_playlist.c Wed Jan 09 23:37:16 2008 +0300 @@ -298,6 +298,7 @@ gchar *tmp = NULL, *tmp2 = NULL; g_return_if_fail(font); + AUDDBG("Attempt to set font \"%s\"\n", font); tmp = g_strdup(font); g_return_if_fail(tmp);
--- a/src/audacious/ui_preferences.c Fri Jan 04 14:42:13 2008 +0100 +++ b/src/audacious/ui_preferences.c Wed Jan 09 23:37:16 2008 +0300 @@ -21,6 +21,8 @@ # include "config.h" #endif +/* #define AUD_DEBUG */ + #include <glib.h> #include <glib/gi18n.h> #include <gtk/gtk.h> @@ -589,16 +591,17 @@ } static void -on_font_btn_realize(GtkFontButton * button, gchar *cfg) +on_font_btn_realize(GtkFontButton * button, gchar **cfg) { - gtk_font_button_set_font_name(button, cfg); + gtk_font_button_set_font_name(button, *cfg); } static void -on_font_btn_font_set(GtkFontButton * button, gchar *cfg) +on_font_btn_font_set(GtkFontButton * button, gchar **cfg) { - g_free(cfg); - cfg = g_strdup(gtk_font_button_get_font_name(button)); + g_free(*cfg); + *cfg = g_strdup(gtk_font_button_get_font_name(button)); + AUDDBG("Returned font name: \"%s\"\n", *cfg); void (*callback) (void) = g_object_get_data(G_OBJECT(button), "callback"); if (callback) callback(); } @@ -612,6 +615,7 @@ static void playlist_font_set_cb() { + AUDDBG("Attempt to set font \"%s\"\n", cfg.playlist_font); ui_skinned_playlist_set_font(cfg.playlist_font); playlistwin_set_sinfo_font(cfg.playlist_font); /* propagate font setting to playlistwin_sinfo */ playlistwin_update_list(playlist_get_active()); @@ -1775,10 +1779,10 @@ g_signal_connect(G_OBJECT(font_btn), "font_set", G_CALLBACK(on_font_btn_font_set), - *(char**)widgets[x].cfg); + (char**)widgets[x].cfg); g_signal_connect(G_OBJECT(font_btn), "realize", G_CALLBACK(on_font_btn_realize), - *(char**)widgets[x].cfg); + (char**)widgets[x].cfg); break; default: /* shouldn't ever happen - expect things to break */