X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f31512df1253bfb6a4c90add6c0697345fd57f2d..61ab70f5ec5869d57fb0712101280e304d38dcbc:/src/simix/smx_process.cpp diff --git a/src/simix/smx_process.cpp b/src/simix/smx_process.cpp index ae48724cfd..5f28c68354 100644 --- a/src/simix/smx_process.cpp +++ b/src/simix/smx_process.cpp @@ -4,20 +4,28 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ +#include +#include +#include +#include + #include #include +#include +#include +#include +#include + +#include + +#include #include "src/surf/surf_interface.hpp" #include "smx_private.h" -#include "xbt/sysdep.h" -#include "xbt/log.h" -#include "xbt/dict.h" -#include "mc/mc.h" #include "src/mc/mc_replay.h" #include "src/mc/Client.hpp" #include "src/msg/msg_private.h" - #include "src/simix/SynchroSleep.hpp" #include "src/simix/SynchroRaw.hpp" #include "src/simix/SynchroIo.hpp" @@ -786,13 +794,14 @@ static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_synch sleep->surf_sleep->unref(); sleep->surf_sleep = nullptr; } - delete sleep; + sleep->unref(); return 0; } smx_synchro_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout) { smx_synchro_t res = SIMIX_process_sleep(issuer, timeout); + static_cast(res)->ref(); SIMIX_process_on_exit(process, (int_f_pvoid_pvoid_t)SIMIX_process_join_finish, res); return res; } @@ -835,6 +844,7 @@ void SIMIX_process_sleep_destroy(smx_synchro_t synchro) if (sleep->surf_sleep) { sleep->surf_sleep->unref(); sleep->surf_sleep = nullptr; + sleep->unref(); } }