]> AND Public Git Repository - simgrid.git/blobdiff - src/xbt/xbt_context.c
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Allow gcc cross-compilation targetting windows
[simgrid.git] / src / xbt / xbt_context.c
index e7975f1def1891779a024f1144bcd879e0624cf6..f3c9ecd62adf8cdb182a2587bcded4b75bf2f535 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