From ab8c6906842306821c8407b87dd82ca952660da0 Mon Sep 17 00:00:00 2001 From: Arnaud Legrand Date: Thu, 22 Aug 2013 13:55:44 +0200 Subject: [PATCH] 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... --- src/simix/smx_global.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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(); -- 2.20.1