arm: Fix memleak in Pl390 by adding destructor
authorSean Wilson <spwilson2@wisc.edu>
Thu, 29 Jun 2017 14:12:26 +0000 (09:12 -0500)
committerSean Wilson <spwilson2@wisc.edu>
Thu, 29 Jun 2017 19:10:13 +0000 (19:10 +0000)
Change-Id: I3395e64311f6aa7bbfb6eee9bfec82e832bcbd4d
Signed-off-by: Sean Wilson <spwilson2@wisc.edu>
Reviewed-on: https://gem5-review.googlesource.com/3901
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

src/dev/arm/gic_pl390.cc
src/dev/arm/gic_pl390.hh

index ce27e94fc3f496a9224f5d4e6e196ff0597c4d8a..7b63306c39236972d6668ad720cd0ce18549c289 100644 (file)
@@ -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)
 {
index 05c9b5f7072bf5869281327bf3557d648339ba4c..5c8a71222fb9295c360375a097fac7f3ba5a0ae2 100644 (file)
@@ -365,6 +365,7 @@ class Pl390 : public BaseGic, public BaseGicRegisters
         return dynamic_cast<const Params *>(_params);
     }
     Pl390(const Params *p);
+    ~Pl390();
 
     DrainState drain() override;