From patchwork Wed Aug 17 14:40:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 3487 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 60D3723F41 for ; Wed, 17 Aug 2011 14:40:25 +0000 (UTC) Received: from mail-ey0-f170.google.com (mail-ey0-f170.google.com [209.85.215.170]) by fiordland.canonical.com (Postfix) with ESMTP id 3336CA18674 for ; Wed, 17 Aug 2011 14:40:24 +0000 (UTC) Received: by eyd10 with SMTP id 10so813062eyd.29 for ; Wed, 17 Aug 2011 07:40:24 -0700 (PDT) Received: by 10.213.29.147 with SMTP id q19mr1277496ebc.132.1313592023761; Wed, 17 Aug 2011 07:40:23 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.213.102.5 with SMTP id e5cs21871ebo; Wed, 17 Aug 2011 07:40:23 -0700 (PDT) Received: from mr.google.com ([10.227.60.143]) by 10.227.60.143 with SMTP id p15mr1379658wbh.37.1313592023517 (num_hops = 1); Wed, 17 Aug 2011 07:40:23 -0700 (PDT) Received: by 10.227.60.143 with SMTP id p15mr970304wbh.37.1313592022912; Wed, 17 Aug 2011 07:40:22 -0700 (PDT) Received: from mtagate7.uk.ibm.com (mtagate7.uk.ibm.com [194.196.100.167]) by mx.google.com with ESMTPS id ge14si3142331wbb.50.2011.08.17.07.40.22 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 17 Aug 2011 07:40:22 -0700 (PDT) Received-SPF: neutral (google.com: 194.196.100.167 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=194.196.100.167; Authentication-Results: mx.google.com; spf=neutral (google.com: 194.196.100.167 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p7HEeMJt021700 for ; Wed, 17 Aug 2011 14:40:22 GMT Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p7HEeLET2465908 for ; Wed, 17 Aug 2011 15:40:21 +0100 Received: from d06av03.portsmouth.uk.ibm.com (localhost.localdomain [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p7HEeLFh016477 for ; Wed, 17 Aug 2011 08:40:21 -0600 Received: from smtp.lab.toulouse-stg.fr.ibm.com (srv01.lab.toulouse-stg.fr.ibm.com [9.101.4.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p7HEeLfV016468; Wed, 17 Aug 2011 08:40:21 -0600 Received: from localhost.localdomain (sig-9-145-151-49.de.ibm.com [9.145.151.49]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id A7F9D210F74; Wed, 17 Aug 2011 16:40:20 +0200 (CEST) From: Daniel Lezcano To: linaro-dev@lists.linaro.org Subject: [powerdebug] fix window leak Date: Wed, 17 Aug 2011 16:40:27 +0200 Message-Id: <1313592027-6153-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.4.1 The main window creation is misplaced in the loop, it is created several times. Signed-off-by: Daniel Lezcano --- display.c | 10 ++++------ 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);