From: Arnaud Legrand Date: Thu, 22 Aug 2013 11:55:44 +0000 (+0200) Subject: My bad. There may be no process at all, hence, surf_solve may not be called, hence... X-Git-Tag: v3_9_90~123^2~38 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ab8c6906842306821c8407b87dd82ca952660da0 My bad. There may be no process at all, hence, surf_solve may not be called, hence we need to check whether this variable has ever been initialized or not... --- diff --git a/src/simix/smx_global.c b/src/simix/smx_global.c index faa20af08f..5b8984b690 100644 --- a/src/simix/smx_global.c +++ b/src/simix/smx_global.c @@ -329,12 +329,14 @@ void SIMIX_run(void) } /* Autorestart all process */ - char *hostname = NULL; - xbt_dynar_foreach(host_that_restart,iter,hostname) { - XBT_INFO("Restart processes on host: %s",hostname); - SIMIX_host_autorestart(SIMIX_host_get_by_name(hostname)); + if(host_that_restart) { + char *hostname = NULL; + xbt_dynar_foreach(host_that_restart,iter,hostname) { + XBT_INFO("Restart processes on host: %s",hostname); + SIMIX_host_autorestart(SIMIX_host_get_by_name(hostname)); + } + xbt_dynar_reset(host_that_restart); } - xbt_dynar_reset(host_that_restart); /* Clean processes to destroy */ SIMIX_process_empty_trash();