From 4272e5735e685afc759b02dfbcb08acaf462c791 Mon Sep 17 00:00:00 2001 From: cherierm Date: Mon, 7 Jan 2008 14:29:26 +0000 Subject: [PATCH] Destroy the context of the maestro after the call of the function xbt_context_empty_trash to avoid an possible access violation. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5160 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/xbt/xbt_context.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xbt/xbt_context.c b/src/xbt/xbt_context.c index e7975f1def..f3c9ecd62a 100644 --- a/src/xbt/xbt_context.c +++ b/src/xbt/xbt_context.c @@ -100,9 +100,6 @@ xbt_context_mod_exit(void) /* remove the context of the scheduler from the list of the contexts in use */ xbt_swag_remove(maestro_context, context_living); - free(maestro_context); - maestro_context = current_context = NULL; - /* * kill all the contexts in use : * the killed contexts are added in the list of the contexts to destroy @@ -114,6 +111,9 @@ xbt_context_mod_exit(void) /* destroy all contexts in the list of contexts to destroy */ xbt_context_empty_trash(); + free(maestro_context); + maestro_context = current_context = NULL; + /* destroy the lists */ xbt_swag_free(context_to_destroy); xbt_swag_free(context_living); -- 2.20.1