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