Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Various cleanups+allow cross-compilation with gcc
[simgrid.git] / src / xbt / xbt_context.c
index e7975f1..f3c9ecd 100644 (file)
@@ -100,9 +100,6 @@ xbt_context_mod_exit(void)
                /* remove the context of the scheduler from the list of the contexts in use */\r
                xbt_swag_remove(maestro_context, context_living);\r
                \r
-               free(maestro_context);\r
-               maestro_context = current_context = NULL;\r
-               \r
                /*  \r
                 * kill all the contexts in use :\r
                 * the killed contexts are added in the list of the contexts to destroy\r
@@ -114,6 +111,9 @@ xbt_context_mod_exit(void)
                /* destroy all contexts in the list of contexts to destroy */\r
                xbt_context_empty_trash();\r
                \r
+               free(maestro_context);\r
+               maestro_context = current_context = NULL;\r
+               \r
                /* destroy the lists */\r
                xbt_swag_free(context_to_destroy);\r
                xbt_swag_free(context_living);\r