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()) {
|
if (!event->squashed()) {
|
||||||
event->process();
|
event->process();
|
||||||
if (event->isExitEvent()) {
|
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;
|
return event;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -56,7 +56,7 @@ SimLoopExitEvent::process()
|
||||||
// queue.
|
// queue.
|
||||||
if (!isFlagSet(IsMainQueue)) {
|
if (!isFlagSet(IsMainQueue)) {
|
||||||
exitSimLoop(cause, code);
|
exitSimLoop(cause, code);
|
||||||
delete this;
|
setFlags(AutoDelete);
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise do nothing... the IsExitEvent flag takes care of
|
// otherwise do nothing... the IsExitEvent flag takes care of
|
||||||
|
|
Loading…
Reference in a new issue