Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Release memory after last use only.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 8 Mar 2019 13:19:50 +0000 (14:19 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 8 Mar 2019 22:09:07 +0000 (23:09 +0100)
src/simix/ActorImpl.cpp

index 3b64841..17c34d2 100644 (file)
@@ -461,8 +461,8 @@ ActorImpl* ActorImpl::start(const simix::ActorCode& code)
   xbt_assert(code && host_ != nullptr, "Invalid parameters");
 
   if (not host_->is_on()) {
   xbt_assert(code && host_ != nullptr, "Invalid parameters");
 
   if (not host_->is_on()) {
-    intrusive_ptr_release(this);
     XBT_WARN("Cannot launch actor '%s' on failed host '%s'", name_.c_str(), host_->get_cname());
     XBT_WARN("Cannot launch actor '%s' on failed host '%s'", name_.c_str(), host_->get_cname());
+    intrusive_ptr_release(this);
     std::rethrow_exception(
         std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Cannot start actor on failed host.")));
   }
     std::rethrow_exception(
         std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Cannot start actor on failed host.")));
   }