From: Rodolfo García Peñas (kix) Date: Wed, 14 Nov 2012 23:53:03 +0000 (+0100) Subject: wIconUpdate wwin checks X-Git-Tag: wmaker-0.95.4~23 X-Git-Url: https://repo.or.cz/w/wmaker-crm.git/commitdiff_plain/0a06ddd9e3398749007deddf392d255f04347822 wIconUpdate wwin checks The variable wwin is only used in one block of the if, so should be moved inside this block. OTOH, is better check if the variabl exists before assign it. The code now is more stable and avoid crashes. --- diff --git a/src/icon.c b/src/icon.c index 0edf53cb..e745619f 100644 --- a/src/icon.c +++ b/src/icon.c @@ -599,11 +599,14 @@ static void unset_icon_image(WIcon *icon) void wIconUpdate(WIcon *icon, RImage *image) { - WWindow *wwin = icon->owner; + WWindow *wwin = NULL; if (image) { icon->file_image = image; } else { + if (icon && icon->owner) + wwin = icon->owner; + if (wwin && WFLAGP(wwin, always_user_icon)) { /* Forced use user_icon */ get_rimage_icon_from_user_icon(icon);