mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-26 08:22:37 +01:00
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.
This commit is contained in:
committed by
Carlos R. Mafra
parent
4b4c5513ce
commit
0a06ddd9e3
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user