Move stop callbacks to be called after run() in sim2.

This commit is contained in:
Alex Miller 2020-04-21 14:32:11 -07:00
parent 75a4f3b7c9
commit 8b004fe8e3
1 changed files with 3 additions and 3 deletions

View File

@ -872,9 +872,6 @@ public:
virtual void stop() {
isStopped = true;
for ( auto& fn : stopCallbacks ) {
fn();
}
}
virtual void addStopCallback( std::function<void()> fn ) {
stopCallbacks.emplace_back(std::move(fn));
@ -1002,6 +999,9 @@ public:
}
self->currentProcess = callingMachine;
self->net2->stop();
for ( auto& fn : self->stopCallbacks ) {
fn();
}
return Void();
}