Sean Wilson has submitted this change and it was merged. ( https://gem5-review.googlesource.com/3900 )

Change subject: arm: Fix memleak in VGic by adding destructor
......................................................................

arm: Fix memleak in VGic by adding destructor

Change-Id: I864b5d9ed655cc52e440e2eb54987e8ff9a73296
Signed-off-by: Sean Wilson <spwils...@wisc.edu>
Reviewed-on: https://gem5-review.googlesource.com/3900
Reviewed-by: Jason Lowe-Power <ja...@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandb...@arm.com>
Maintainer: Andreas Sandberg <andreas.sandb...@arm.com>
---
M src/dev/arm/vgic.cc
M src/dev/arm/vgic.hh
2 files changed, 7 insertions(+), 0 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Andreas Sandberg: Looks good to me, approved; Looks good to me, approved



diff --git a/src/dev/arm/vgic.cc b/src/dev/arm/vgic.cc
index 60866f1..6744ad5 100644
--- a/src/dev/arm/vgic.cc
+++ b/src/dev/arm/vgic.cc
@@ -60,6 +60,12 @@
     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 8328673..e9bc29c 100644
--- a/src/dev/arm/vgic.hh
+++ b/src/dev/arm/vgic.hh
@@ -206,6 +206,7 @@
         return dynamic_cast<const Params *>(_params);
     }
     VGic(const Params *p);
+    ~VGic();

     AddrRangeList getAddrRanges() const override;


--
To view, visit https://gem5-review.googlesource.com/3900
To unsubscribe, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I864b5d9ed655cc52e440e2eb54987e8ff9a73296
Gerrit-Change-Number: 3900
Gerrit-PatchSet: 2
Gerrit-Owner: Sean Wilson <spwils...@wisc.edu>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Sean Wilson <spwils...@wisc.edu>
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to