X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6b78c1f2adcbcd474c0a76e1c4c0fc44b120d7cd..0f9c16dc1c877e21cf0a8c538e62f94dc66bce49:/src/simix/ActorImpl.cpp diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index 758d26d432..dca4a3b11c 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -111,10 +111,8 @@ void SIMIX_process_cleanup(smx_actor_t process) if (comm->detached) XBT_DEBUG("Don't destroy it since it's a detached comm and I'm the sender"); else - comm->unref(); - - } - else if (comm->dst_proc == process){ + SIMIX_comm_unref(comm); + } else if (comm->dst_proc == process) { XBT_DEBUG("Found an unfinished recv comm %p, state %d, src = %p, dst = %p", comm, (int)comm->state, comm->src_proc, comm->dst_proc); comm->dst_proc = nullptr; @@ -123,8 +121,7 @@ void SIMIX_process_cleanup(smx_actor_t process) /* the comm will be freed right now, remove it from the sender */ comm->src_proc->comms.remove(comm); } - - comm->unref(); + SIMIX_comm_unref(comm); } else { xbt_die("Communication synchro %p is in my list but I'm not the sender nor the receiver", synchro); } @@ -440,16 +437,11 @@ void SIMIX_process_kill(smx_actor_t process, smx_actor_t issuer) { } else if (comm != nullptr) { process->comms.remove(process->waiting_synchro); comm->cancel(); - // Remove first occurrence of &process->simcall: - auto i = boost::range::find( - process->waiting_synchro->simcalls, - &process->simcall); + auto i = boost::range::find(process->waiting_synchro->simcalls, &process->simcall); if (i != process->waiting_synchro->simcalls.end()) process->waiting_synchro->simcalls.remove(&process->simcall); - - comm->unref(); - + SIMIX_comm_unref(comm); } else if (sleep != nullptr) { SIMIX_process_sleep_destroy(process->waiting_synchro);