1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 21:08:08 +01:00

Fixed memory leak in wHideAll.

This commit is contained in:
Tobias Stoeckmann
2012-05-03 17:48:56 +02:00
committed by Carlos R. Mafra
parent 2755b1e45d
commit 753f44c4b7

View File

@@ -1227,13 +1227,13 @@ void wHideAll(WScreen *scr)
menu = scr->switch_menu;
windows = malloc(sizeof(WWindow *));
windows = wmalloc(sizeof(WWindow *));
if (menu != NULL) {
for (i = 0; i < menu->entry_no; i++) {
windows[wcount] = (WWindow *) menu->entries[i]->clientdata;
wcount++;
windows = realloc(windows, sizeof(WWindow *) * (wcount+1));
windows = wrealloc(windows, sizeof(WWindow *) * (wcount + 1));
}
} else {
wwin = scr->focused_window;
@@ -1241,7 +1241,7 @@ void wHideAll(WScreen *scr)
while (wwin) {
windows[wcount] = wwin;
wcount++;
windows = realloc(windows, sizeof(WWindow *) * (wcount+1));
windows = wrealloc(windows, sizeof(WWindow *) * (wcount + 1));
wwin = wwin->prev;
}
@@ -1258,6 +1258,8 @@ void wHideAll(WScreen *scr)
wIconifyWindow(wwin);
}
}
wfree(windows);
}
void wHideOtherApplications(WWindow *awin)