From 9e8aa9b973e34885283f1d41b041321b7c4f7b32 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 VGic by adding destructor Change-Id: I864b5d9ed655cc52e440e2eb54987e8ff9a73296 Signed-off-by: Sean Wilson Reviewed-on: https://gem5-review.googlesource.com/3900 Reviewed-by: Jason Lowe-Power Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg --- src/dev/arm/vgic.cc | 6 ++++++ src/dev/arm/vgic.hh | 1 + 2 files changed, 7 insertions(+) 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(_params); } VGic(const Params *p); + ~VGic(); AddrRangeList getAddrRanges() const override; -- 2.30.2