client: fix icon value on changes
Sometimes we unref the icon image, but we did not reset NULL, which can make the client refering to a not-refed image. Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
0eee6795df
commit
b811880c54
1
client.c
1
client.c
|
@ -1460,6 +1460,7 @@ luaA_client_newindex(lua_State *L)
|
|||
break;
|
||||
case A_TK_ICON:
|
||||
image_unref(L, c->icon);
|
||||
c->icon = NULL;
|
||||
c->icon = image_ref(L, 3);
|
||||
/* execute hook */
|
||||
hook_property(client, c, "icon");
|
||||
|
|
|
@ -356,6 +356,8 @@ property_handle_net_wm_icon(void *data,
|
|||
image_unref(globalconf.L, c->icon);
|
||||
if(ewmh_window_icon_from_reply(reply))
|
||||
c->icon = image_ref(globalconf.L, -1);
|
||||
else
|
||||
c->icon = NULL;
|
||||
/* execute hook */
|
||||
hook_property(client, c, "icon");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue