# HG changeset patch # User mhessling@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1048746773 0 # Node ID d2392cf845e47fdb65df61c2a3047f774ead0fb0 # Parent aac3ab26d636c3ee0dc531ae83ae703bbaca7cee Fix crash if dw_icon_load_from_file() called before creating a toplevel window. Only affects GTK < 2.0 and not using IMLIB. Use correct cast for itemdata in _tree_select_event(). diff -r aac3ab26d636 -r d2392cf845e4 gtk/dw.c --- a/gtk/dw.c Wed Mar 26 07:03:04 2003 +0000 +++ b/gtk/dw.c Thu Mar 27 06:32:53 2003 +0000 @@ -514,7 +514,7 @@ { int (*treeselectfunc)(HWND, HWND, char *, void *, void *) = work->func; char *text = (char *)gtk_object_get_data(GTK_OBJECT(child), "text"); - void *itemdata = (char *)gtk_object_get_data(GTK_OBJECT(child), "itemdata"); + void *itemdata = (void *)gtk_object_get_data(GTK_OBJECT(child), "itemdata"); retval = treeselectfunc(work->window, child, text, itemdata, work->data); } return retval; @@ -4370,7 +4370,8 @@ gdk_imlib_destroy_image(image); } #else - _PixmapArray[found].pixmap = gdk_pixmap_create_from_xpm(last_window->window, &_PixmapArray[found].mask, &_colors[DW_CLR_PALEGRAY], file); + if (last_window) + _PixmapArray[found].pixmap = gdk_pixmap_create_from_xpm(last_window->window, &_PixmapArray[found].mask, &_colors[DW_CLR_PALEGRAY], file); #endif DW_MUTEX_UNLOCK; if(!_PixmapArray[found].pixmap || !_PixmapArray[found].mask)