From 637e1ec740b78bf063190c3068a9c50cf8207637 Mon Sep 17 00:00:00 2001 From: Sean Wilson Date: Thu, 29 Jun 2017 09:12:26 -0500 Subject: [PATCH] arm: Fix memleak in Pl390 by adding destructor Change-Id: I3395e64311f6aa7bbfb6eee9bfec82e832bcbd4d Signed-off-by: Sean Wilson Reviewed-on: https://gem5-review.googlesource.com/3901 Reviewed-by: Jason Lowe-Power Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg --- src/dev/arm/gic_pl390.cc | 6 ++++++ src/dev/arm/gic_pl390.hh | 1 + 2 files changed, 7 insertions(+) diff --git a/src/dev/arm/gic_pl390.cc b/src/dev/arm/gic_pl390.cc index ce27e94fc..7b63306c3 100644 --- a/src/dev/arm/gic_pl390.cc +++ b/src/dev/arm/gic_pl390.cc @@ -95,6 +95,12 @@ Pl390::Pl390(const Params *p) gem5ExtensionsEnabled = false; } +Pl390::~Pl390() +{ + for (int x = 0; x < CPU_MAX; x++) + delete postIntEvent[x]; +} + Tick Pl390::read(PacketPtr pkt) { diff --git a/src/dev/arm/gic_pl390.hh b/src/dev/arm/gic_pl390.hh index 05c9b5f70..5c8a71222 100644 --- a/src/dev/arm/gic_pl390.hh +++ b/src/dev/arm/gic_pl390.hh @@ -365,6 +365,7 @@ class Pl390 : public BaseGic, public BaseGicRegisters return dynamic_cast(_params); } Pl390(const Params *p); + ~Pl390(); DrainState drain() override; -- 2.30.2