mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
On startup, don't leak memory when we enumerate existing windows.
The behaviour until now was to ask X for the windows name (which is malloced) then drop that on the floor and do nothing with it. Skip this foolery and just skip the window. I don't believe I never noticed this before! "you can has ok" okan@
This commit is contained in:
parent
49e218cf53
commit
5c757cc7f4
5
calmwm.c
5
calmwm.c
@ -229,11 +229,8 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
|
|||||||
for (i = 0; i < nwins; i++) {
|
for (i = 0; i < nwins; i++) {
|
||||||
XGetWindowAttributes(X_Dpy, wins[i], &winattr);
|
XGetWindowAttributes(X_Dpy, wins[i], &winattr);
|
||||||
if (winattr.override_redirect ||
|
if (winattr.override_redirect ||
|
||||||
winattr.map_state != IsViewable) {
|
winattr.map_state != IsViewable)
|
||||||
char *name;
|
|
||||||
XFetchName(X_Dpy, wins[i], &name);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
client_new(wins[i], sc, winattr.map_state != IsUnmapped);
|
client_new(wins[i], sc, winattr.map_state != IsUnmapped);
|
||||||
}
|
}
|
||||||
XFree(wins);
|
XFree(wins);
|
||||||
|
Loading…
Reference in New Issue
Block a user