From b811880c54ecfcdbb0b25680abeac066c82ad844 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 18 Jun 2009 12:13:00 +0200 Subject: [PATCH] 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 --- client.c | 1 + property.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/client.c b/client.c index 24733f8a..c2a3e081 100644 --- a/client.c +++ b/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"); diff --git a/property.c b/property.c index c39e7f9f..b9322e1c 100644 --- a/property.c +++ b/property.c @@ -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"); }