From: Arnaud Giersch Date: Wed, 2 Aug 2017 20:15:28 +0000 (+0200) Subject: Don't try to get front() from an empty list. X-Git-Tag: v3_17~282 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8fdd2b7c6dde1c00cbc4b6c8036e33f719276076 Don't try to get front() from an empty list. --- diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index bd2ab82149..aac766fa14 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -79,8 +79,9 @@ void SIMIX_process_cleanup(smx_actor_t process) xbt_os_mutex_acquire(simix_global->mutex); /* cancel non-blocking communications */ - smx_activity_t synchro = process->comms.front(); while (not process->comms.empty()) { + smx_activity_t synchro = process->comms.front(); + process->comms.pop_front(); simgrid::kernel::activity::CommImplPtr comm = boost::static_pointer_cast(synchro); @@ -104,8 +105,6 @@ void SIMIX_process_cleanup(smx_actor_t process) } else { xbt_die("Communication synchro %p is in my list but I'm not the sender nor the receiver", synchro.get()); } - process->comms.pop_front(); - synchro = process->comms.front(); comm->cancel(); }