Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/14400
Change subject: sim: Deschedule existing events when destructing an event
queue.
......................................................................
sim: Deschedule existing events when destructing an event queue.
Other objects in the simulation may try to deschedule their events when
destructed, and if they're cleaned up after the event queue is then
they might try to deschedule events on an event queue that no longer
exists.
Change-Id: I9452ce52fba78297ce3dc4b3884289b5e2f2574d
---
M src/sim/eventq.hh
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/sim/eventq.hh b/src/sim/eventq.hh
index 781bcdb..6e8e633 100644
--- a/src/sim/eventq.hh
+++ b/src/sim/eventq.hh
@@ -711,7 +711,11 @@
*/
void checkpointReschedule(Event *event);
- virtual ~EventQueue() { }
+ virtual ~EventQueue()
+ {
+ while (!empty())
+ deschedule(getHead());
+ }
};
void dumpMainQueue();
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/14400
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I9452ce52fba78297ce3dc4b3884289b5e2f2574d
Gerrit-Change-Number: 14400
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev