Mercurial > audlegacy
changeset 3602:968144b94ece
Don't crash when the skin doesn't actually exist.
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Sun, 23 Sep 2007 13:47:38 -0500 |
parents | 98ba3170b2de |
children | c983b83967db |
files | src/audacious/skin.c |
diffstat | 1 files changed, 18 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/audacious/skin.c Sun Sep 23 13:42:10 2007 -0500 +++ b/src/audacious/skin.c Sun Sep 23 13:47:38 2007 -0500 @@ -309,14 +309,6 @@ width = gdk_pixbuf_get_width(pixbuf); height = gdk_pixbuf_get_height(pixbuf); - /* create the windows if they haven't been created yet, needed for bootstrapping */ - if (mainwin == NULL) - { - mainwin_create(); - equalizerwin_create(); - playlistwin_create(); - } - if (!(pixmap = gdk_pixmap_new(mainwin->window, width, height, gdk_rgb_get_visual()->depth))) { g_object_unref(pixbuf); @@ -517,6 +509,14 @@ { bmp_active_skin = skin_new(); + /* create the windows if they haven't been created yet, needed for bootstrapping */ + if (mainwin == NULL) + { + mainwin_create(); + equalizerwin_create(); + playlistwin_create(); + } + if (!bmp_active_skin_load(path)) { /* FIXME: Oddly, g_message() causes a crash if path is NULL on * Solaris (see bug #165) */ @@ -1392,9 +1392,13 @@ else cursor_gdk = gdk_cursor_new(GDK_LEFT_PTR); - gdk_window_set_cursor(mainwin->window, cursor_gdk); - gdk_window_set_cursor(playlistwin->window, cursor_gdk); - gdk_window_set_cursor(equalizerwin->window, cursor_gdk); + if (mainwin && playlistwin && equalizerwin) + { + gdk_window_set_cursor(mainwin->window, cursor_gdk); + gdk_window_set_cursor(playlistwin->window, cursor_gdk); + gdk_window_set_cursor(equalizerwin->window, cursor_gdk); + } + gdk_cursor_unref(cursor_gdk); } @@ -1422,6 +1426,9 @@ filename = find_file_recursively(path, "pledit.txt"); inifile = open_ini_file(filename); + if (!inifile) + return; + skin->colors[SKIN_PLEDIT_NORMAL] = skin_load_color(inifile, "Text", "Normal", "#2499ff"); skin->colors[SKIN_PLEDIT_CURRENT] =