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
382dc83eb0
commit
f9f6e78aa5
1
client.c
1
client.c
|
@ -1521,6 +1521,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);
|
||||
/* execute hook */
|
||||
hooks_property(c, "icon");
|
||||
|
|
|
@ -354,6 +354,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);
|
||||
else
|
||||
c->icon = NULL;
|
||||
/* execute hook */
|
||||
hooks_property(c, "icon");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue