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:
Julien Danjou 2009-06-18 12:14:39 +02:00
parent 382dc83eb0
commit f9f6e78aa5
2 changed files with 3 additions and 0 deletions

View File

@ -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");

View File

@ -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");
}