X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2a6d1b59788a13c520e32f3def71d0fc280d532d..f4d117984401d94136223dc1d254a288c06606f2:/src/bindings/lua/simgrid_lua.c diff --git a/src/bindings/lua/simgrid_lua.c b/src/bindings/lua/simgrid_lua.c index 2df56d5690..11e4badf34 100644 --- a/src/bindings/lua/simgrid_lua.c +++ b/src/bindings/lua/simgrid_lua.c @@ -185,7 +185,9 @@ static int get_clock(lua_State* L) { */ static int simgrid_gc(lua_State * L) { - MSG_clean(); + if (sglua_is_maestro(L)) { + MSG_clean(); + } return 0; } @@ -194,7 +196,7 @@ static int simgrid_gc(lua_State * L) */ static int msg_register_platform(lua_State * L) { - /* Tell Simgrid we dont wanna use its parser */ + /* Tell Simgrid we don't wanna use its parser */ //surf_parse = console_parse_platform; surf_parse_reset_callbacks(); MSG_create_environment(NULL); @@ -317,6 +319,7 @@ int luaopen_simgrid(lua_State *L) /* Initialize the MSG core */ MSG_global_init(&argc, argv); + MSG_process_set_data_cleanup((void_f_pvoid_t) lua_close); XBT_DEBUG("Still %d arguments on command line", argc); // FIXME: update the lua's arg table to reflect the changes from SimGrid }