From: Martin Quinson Date: Wed, 7 Jun 2017 23:54:16 +0000 (+0200) Subject: correct refcounting of ActorPtr X-Git-Tag: v3.16~108 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/69901c51b9fbfb0a3e5dbc8a8ac1678adfcb0465 correct refcounting of ActorPtr --- diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index d105dffe43..445aabc6d3 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -279,7 +279,7 @@ smx_actor_t SIMIX_process_create(const char* name, std::function code, v if (host->extension() == nullptr) host->extension_set(new simgrid::simix::Host()); - /* Add the process to it's host process list */ + /* Add the process to its host process list */ xbt_swag_insert(process, host->extension()->process_list); XBT_DEBUG("Start context '%s'", process->name.c_str()); @@ -288,6 +288,7 @@ smx_actor_t SIMIX_process_create(const char* name, std::function code, v simix_global->process_list[process->pid] = process; XBT_DEBUG("Inserting %s(%s) in the to_run list", process->cname(), host->cname()); xbt_dynar_push_as(simix_global->process_to_run, smx_actor_t, process); + intrusive_ptr_add_ref(process); /* Tracing the process creation */ TRACE_msg_process_create(process->cname(), process->pid, process->host);