X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/013aee5c38d6c531af7a469a89d6474a19233d3f..fb33f893495b18dc7a0e13182b901d4cf662150f:/src/s4u/s4u_netzone.cpp diff --git a/src/s4u/s4u_netzone.cpp b/src/s4u/s4u_netzone.cpp index 153be093f9..780baadf35 100644 --- a/src/s4u/s4u_netzone.cpp +++ b/src/s4u/s4u_netzone.cpp @@ -23,11 +23,6 @@ simgrid::xbt::signalname()); - if (host != nullptr) - hosts_->push_back(host); - } } void NetZone::seal() @@ -43,6 +38,7 @@ NetZone::~NetZone() delete static_cast(elem); } + delete hosts_; xbt_dict_free(&children_); xbt_free(name_); } @@ -80,6 +76,11 @@ NetZone* NetZone::father() std::vector* NetZone::hosts() { + for (auto card : vertices_) { + s4u::Host* host = simgrid::s4u::Host::by_name_or_null(card->name()); + if (host != nullptr) + hosts_->push_back(host); + } return hosts_; }