Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Clear the 'on_exit' vector when the actor doesn't have to restart.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 24 Apr 2019 12:09:23 +0000 (14:09 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 24 Apr 2019 12:09:31 +0000 (14:09 +0200)
The python tests actor-kill and actor-daemon were failing.

src/kernel/actor/ActorImpl.cpp

index 86b8b59..aec21aa 100644 (file)
@@ -143,6 +143,8 @@ void ActorImpl::cleanup()
   bool failed = context_->iwannadie;
   for (auto exit_fun = on_exit->crbegin(); exit_fun != on_exit->crend(); ++exit_fun)
     (*exit_fun)(failed);
   bool failed = context_->iwannadie;
   for (auto exit_fun = on_exit->crbegin(); exit_fun != on_exit->crend(); ++exit_fun)
     (*exit_fun)(failed);
+  if (not has_to_auto_restart())
+    on_exit->clear();
 
   /* cancel non-blocking activities */
   for (auto activity : comms)
 
   /* cancel non-blocking activities */
   for (auto activity : comms)