Content-Type: multipart/mixed; boundary="===============5853223011887022526==" MIME-Version: 1.0 From: Joe Konno Subject: [Powertop] [PATCH v2 3/8] Remove another memory leak Date: Tue, 14 Oct 2014 11:09:14 -0700 Message-ID: <1413310159-30577-4-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: --===============5853223011887022526== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Dan Kalowsky Pointer gets over written without ever being properly cleaned up. This should solve that problem. v2: rebased atop 41c54e8, do not delete window in clear_tunables() to prevent double-free in close_display(). Signed-off-by: Joe Konno --- src/tuning/tuning.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tuning/tuning.cpp b/src/tuning/tuning.cpp index 7d64cad..5414022 100644 --- a/src/tuning/tuning.cpp +++ b/src/tuning/tuning.cpp @@ -46,6 +46,8 @@ static void sort_tunables(void); static bool should_clear =3D false; = +class tuning_window *tune_window; + class tuning_window: public tab_window { public: virtual void repaint(void); @@ -80,6 +82,11 @@ void initialize_tuning(void) init_tuning(); = w->cursor_max =3D all_tunables.size() - 1; + + if (tune_window) + delete tune_window; + + tune_window =3D w; } = = -- = 2.1.2 --===============5853223011887022526==--