summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Wilson <spwilson2@wisc.edu>2017-06-29 09:12:26 -0500
committerSean Wilson <spwilson2@wisc.edu>2017-06-29 19:10:13 +0000
commit9e8aa9b973e34885283f1d41b041321b7c4f7b32 (patch)
tree36fd25ab9338eecf4b97d8b176aa8365ca5f9133 /src
parent2beb74355697034720562e5d4b6d16c12510eb4a (diff)
downloadgem5-9e8aa9b973e34885283f1d41b041321b7c4f7b32.tar.xz
arm: Fix memleak in VGic by adding destructor
Change-Id: I864b5d9ed655cc52e440e2eb54987e8ff9a73296 Signed-off-by: Sean Wilson <spwilson2@wisc.edu> Reviewed-on: https://gem5-review.googlesource.com/3900 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src')
-rw-r--r--src/dev/arm/vgic.cc6
-rw-r--r--src/dev/arm/vgic.hh1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/dev/arm/vgic.cc b/src/dev/arm/vgic.cc
index 60866f1f4..6744ad513 100644
--- a/src/dev/arm/vgic.cc
+++ b/src/dev/arm/vgic.cc
@@ -60,6 +60,12 @@ VGic::VGic(const Params *p)
assert(sys->numRunningContexts() <= VGIC_CPU_MAX);
}
+VGic::~VGic()
+{
+ for (int x = 0; x < VGIC_CPU_MAX; x++)
+ delete postVIntEvent[x];
+}
+
Tick
VGic::read(PacketPtr pkt)
{
diff --git a/src/dev/arm/vgic.hh b/src/dev/arm/vgic.hh
index 8328673d5..e9bc29c18 100644
--- a/src/dev/arm/vgic.hh
+++ b/src/dev/arm/vgic.hh
@@ -206,6 +206,7 @@ class VGic : public PioDevice
return dynamic_cast<const Params *>(_params);
}
VGic(const Params *p);
+ ~VGic();
AddrRangeList getAddrRanges() const override;