fix: drop stale overlay icon texture on re-resolve

This commit is contained in:
Andrew Hamilton 2026-09-11 08:10:01 +10:00
parent 8a69b99ae5
commit 21d686df5d

7
kick.c
View file

@ -2113,6 +2113,13 @@ static void overlay_icon_load_window(struct kick_window *w) {
w->icon_resolved = true;
const char *id = window_app_id(w);
snprintf(w->icon_app_id, sizeof(w->icon_app_id), "%s", id ? id : "");
/* Re-resolves happen on every map and app_id change: drop the previous
texture first, or one leaks per reload (overlay_make_icon only
overwrites the pointer). Protocol icons never reach here. */
if (w->icon_wlr) {
wlr_texture_destroy(w->icon_wlr);
w->icon_wlr = NULL;
}
overlay_make_icon(w->icon_app_id,
&w->icon_w, &w->icon_h, &w->icon_wlr);
if (w->icon_wlr)