From: Sean Wilson Date: Thu, 29 Jun 2017 14:12:26 +0000 (-0500) Subject: arm: Fix memleak in Pl390 by adding destructor X-Git-Tag: v19.0.0.0~2726 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=637e1ec740b78bf063190c3068a9c50cf8207637;p=gem5.git 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 --- 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;