sim: Fix as issue where exit events on instr queues are used after freed.
This commit is contained in:
parent
4440332bdd
commit
d0678d1c31
2 changed files with 3 additions and 2 deletions
|
@ -203,7 +203,8 @@ EventQueue::serviceOne()
|
|||
if (!event->squashed()) {
|
||||
event->process();
|
||||
if (event->isExitEvent()) {
|
||||
assert(!event->flags.isSet(Event::AutoDelete)); // would be silly
|
||||
assert(!event->flags.isSet(Event::AutoDelete) ||
|
||||
!event->flags.isSet(Event::IsMainQueue)); // would be silly
|
||||
return event;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -56,7 +56,7 @@ SimLoopExitEvent::process()
|
|||
// queue.
|
||||
if (!isFlagSet(IsMainQueue)) {
|
||||
exitSimLoop(cause, code);
|
||||
delete this;
|
||||
setFlags(AutoDelete);
|
||||
}
|
||||
|
||||
// otherwise do nothing... the IsExitEvent flag takes care of
|
||||
|
|
Loading…
Reference in a new issue