From: Frederic Suter Date: Wed, 6 Jun 2018 12:15:47 +0000 (+0200) Subject: fix build (and please valgrind) X-Git-Tag: v3.20~143 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/95851f0825611446cc2425e9d02710ffa253f944 fix build (and please valgrind) --- diff --git a/include/simgrid/s4u/Link.hpp b/include/simgrid/s4u/Link.hpp index d95a753bc0..c02774c7b0 100644 --- a/include/simgrid/s4u/Link.hpp +++ b/include/simgrid/s4u/Link.hpp @@ -34,7 +34,6 @@ class XBT_PUBLIC Link : public simgrid::xbt::Extendable { public: enum class SharingPolicy { SPLITDUPLEX = 2, SHARED = 1, FATPIPE = 0 }; - virtual void destroy(); kernel::resource::LinkImpl* get_impl() { return pimpl_; } /** @brief Retrieve a link from its name */ diff --git a/src/kernel/EngineImpl.cpp b/src/kernel/EngineImpl.cpp index 9fa10c8a12..401e3a764b 100644 --- a/src/kernel/EngineImpl.cpp +++ b/src/kernel/EngineImpl.cpp @@ -7,8 +7,8 @@ #include "simgrid/kernel/routing/NetPoint.hpp" #include "simgrid/kernel/routing/NetZoneImpl.hpp" #include "simgrid/s4u/Host.hpp" -#include "simgrid/s4u/Link.hpp" #include "src/surf/StorageImpl.hpp" +#include "src/surf/network_interface.hpp" #include @@ -42,9 +42,10 @@ EngineImpl::~EngineImpl() for (auto const& kv : storages_) if (kv.second) kv.second->getImpl()->destroy(); + for (auto const& kv : links_) if (kv.second) - (kv.second)->destroy(); + kv.second->get_impl()->destroy(); } } } diff --git a/src/s4u/s4u_Link.cpp b/src/s4u/s4u_Link.cpp index c084839bcd..bf07bfdd9a 100644 --- a/src/s4u/s4u_Link.cpp +++ b/src/s4u/s4u_Link.cpp @@ -25,15 +25,6 @@ simgrid::xbt::signal Link::on_bandwidth_change; simgrid::xbt::signal Link::on_communicate; simgrid::xbt::signal Link::on_communication_state_change; -void Link::destroy() -{ - if (not currentlyDestroying_) { - currentlyDestroying_ = true; - on_destruction(*this); - Engine::get_instance()->link_unregister(std::string(pimpl_->get_cname())); - } -} - Link* Link::by_name(std::string name) { return Engine::get_instance()->link_by_name(name);