Content-Type: multipart/mixed; boundary="===============1348278532330647028==" MIME-Version: 1.0 From: Joe Konno Subject: [Powertop] [PATCH v2 1/8] Properly cleaning up the display tabs Date: Tue, 14 Oct 2014 11:09:12 -0700 Message-ID: <1413310159-30577-2-git-send-email-joe.konno@linux.intel.com> In-Reply-To: 1413310159-30577-1-git-send-email-joe.konno@linux.intel.com To: powertop@lists.01.org List-ID: --===============1348278532330647028== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Dan Kalowsky This patch properly cleans up the display tabs so that none of the tab data is being leaked between refresh changes Signed-off-by: Dan Kalowsky v2: rebased atop 41c54e8; there's a bug here Signed-off-by: Joe Konno --- src/display.cpp | 11 +++++++++++ src/display.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/display.cpp b/src/display.cpp index 123620a..e227e74 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -87,6 +87,17 @@ void reset_display(void) resetterm(); } = +void close_display(void) +{ + for (unsigned int i =3D 0; i < tab_windows.size(); i++) { + if (tab_windows[tab_names[i]]) + delete tab_windows[tab_names[i]]; + tab_windows[tab_names[i]] =3D NULL; + } + + tab_names.clear(); +} + = WINDOW *tab_bar =3D NULL; WINDOW *bottom_line =3D NULL; diff --git a/src/display.h b/src/display.h index 9af3ec0..c3e8d61 100644 --- a/src/display.h +++ b/src/display.h @@ -34,6 +34,7 @@ using namespace std; = extern void init_display(void); extern void reset_display(void); +extern void close_display(void); extern int ncurses_initialized(void); extern void show_tab(unsigned int tab); extern void show_next_tab(void); -- = 2.1.2 --===============1348278532330647028==--