X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d2d907185a41d4e59e9f4eaa7d42700ea9483140..702d0b8f5973b3f1ce01e0f334842a5279fb17d9:/src/kernel/actor/ActorImpl.cpp diff --git a/src/kernel/actor/ActorImpl.cpp b/src/kernel/actor/ActorImpl.cpp index ab52d77f95..c31407c38c 100644 --- a/src/kernel/actor/ActorImpl.cpp +++ b/src/kernel/actor/ActorImpl.cpp @@ -59,7 +59,11 @@ ActorImpl::ActorImpl(const simgrid::xbt::string& name, s4u::Host* host) : host_( simcall.issuer = this; } -ActorImpl::~ActorImpl() = default; +ActorImpl::~ActorImpl() { + context_->iwannadie = false; // don't let the simcall's yield() do a Context::stop(), to avoid infinite loops + simgrid::simix::simcall([this] { simgrid::s4u::Actor::on_destruction(*ciface()); }); + context_->iwannadie = true; +} /* Become an actor in the simulation * @@ -178,10 +182,6 @@ void ActorImpl::cleanup() } simix_global->mutex.unlock(); - - context_->iwannadie = false; // don't let the simcall's yield() do a Context::stop(), to avoid infinite loops - simgrid::simix::simcall([this] { simgrid::s4u::Actor::on_destruction(*ciface()); }); - context_->iwannadie = true; } void ActorImpl::exit()