aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2011-08-17 16:24:01 +0200
committerDaniel Lezcano <daniel.lezcano@linaro.org>2011-08-17 16:24:01 +0200
commitaddc4a7afb2e84709028bca76ec969069dc6118a (patch)
treec5c69187973e5ad46512d4a8278fbc2347dd3836
parent856efcd3eb3b2ac0c0742aa115054cdffb4c4bf2 (diff)
downloadpowerdebug-addc4a7afb2e84709028bca76ec969069dc6118a.tar.gz
fix window leak
The main window creation is misplaced in the loop, it is created several times. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-rw-r--r--display.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/display.c b/display.c
index ebc4de6..28c47f3 100644
--- a/display.c
+++ b/display.c
@@ -548,16 +548,14 @@ int display_init(int wdefault)
getmaxyx(stdscr, maxy, maxx);
- for (i = 0; i < array_size; i++) {
-
- main_win = subwin(stdscr, maxy - 2, maxx, 1, 0);
- if (!main_win)
- return -1;
+ main_win = subwin(stdscr, maxy - 2, maxx, 1, 0);
+ if (!main_win)
+ return -1;
+ for (i = 0; i < array_size; i++) {
windata[i].pad = newpad(maxrows, maxx);
if (!windata[i].pad)
return -1;
-
}
header_win = subwin(stdscr, 1, maxx, 0, 0);