Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Libs created in surf_init should be destroyed be surf_exit
authorChristophe Thiéry <christopho128@gmail.com>
Mon, 18 Apr 2011 09:04:21 +0000 (11:04 +0200)
committerChristophe Thiéry <christopho128@gmail.com>
Mon, 18 Apr 2011 09:04:21 +0000 (11:04 +0200)
src/msg/global.c
src/simdag/sd_global.c
src/surf/surf.c

index 6aa780d..55d4b0a 100644 (file)
@@ -197,11 +197,6 @@ MSG_error_t MSG_clean(void)
 
   SIMIX_clean();
 
 
   SIMIX_clean();
 
-  // Exit the LIB host_lib
-  xbt_lib_free(&host_lib);
-  xbt_lib_free(&link_lib);
-  xbt_lib_free(&as_router_lib);
-
   return MSG_OK;
 }
 
   return MSG_OK;
 }
 
index 87a0995..e3f7a55 100644 (file)
@@ -424,11 +424,6 @@ void SD_exit(void)
     XBT_DEBUG("Exiting Surf...");
     surf_exit();
 
     XBT_DEBUG("Exiting Surf...");
     surf_exit();
 
-    // Exit the LIB host_lib
-    xbt_lib_free(&host_lib);
-    xbt_lib_free(&link_lib);
-    xbt_lib_free(&as_router_lib);
-
     xbt_free(sd_global);
     sd_global = NULL;
 
     xbt_free(sd_global);
     sd_global = NULL;
 
index e8d350f..74f7519 100644 (file)
@@ -382,9 +382,14 @@ void surf_exit(void)
   if (surf_path)
     xbt_dynar_free(&surf_path);
 
   if (surf_path)
     xbt_dynar_free(&surf_path);
 
+  xbt_lib_free(&host_lib);
+  xbt_lib_free(&link_lib);
+  xbt_lib_free(&as_router_lib);
+
   tmgr_finalize();
   surf_parse_lex_destroy();
   surf_parse_free_callbacks();
   tmgr_finalize();
   surf_parse_lex_destroy();
   surf_parse_free_callbacks();
+
   NOW = 0;                      /* Just in case the user plans to restart the simulation afterward */
 }
 
   NOW = 0;                      /* Just in case the user plans to restart the simulation afterward */
 }