summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-11-16 16:27:58 -0800
committerGabe Black <gabeblack@google.com>2018-11-20 21:28:48 +0000
commitdb442c10391586f007ac060245dc322a38c9b204 (patch)
tree251740447c272de2a6b6fac5e8ad56f853cbea4b
parent9afba24af299493adc86ed471b2464f33a1539e2 (diff)
downloadgem5-db442c10391586f007ac060245dc322a38c9b204.tar.xz
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 Reviewed-on: https://gem5-review.googlesource.com/c/14400 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
-rw-r--r--src/sim/eventq.hh6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sim/eventq.hh b/src/sim/eventq.hh
index 781bcdbf9..6e8e63338 100644
--- a/src/sim/eventq.hh
+++ b/src/sim/eventq.hh
@@ -711,7 +711,11 @@ class EventQueue
*/
void checkpointReschedule(Event *event);
- virtual ~EventQueue() { }
+ virtual ~EventQueue()
+ {
+ while (!empty())
+ deschedule(getHead());
+ }
};
void dumpMainQueue();