Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[surf] Move networkLinkCreatedCallbacks outside of constructor
[simgrid.git] / src / surf / network_interface.cpp
index 37ee98e..380332f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2014. The SimGrid Team.
+/* Copyright (c) 2013-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -79,6 +79,7 @@ Link **Link::linksList() {
 void Link::linksExit() {
        for (auto kv : *links)
                delete (kv.second);
+       delete links;
 }
 /*************
  * Callbacks *
@@ -180,7 +181,6 @@ Link::Link(NetworkModel *model, const char *name, xbt_dict_t props)
 : Resource(model, name, props)
 , p_latEvent(NULL)
 {
-  surf_callback_emit(networkLinkCreatedCallbacks, this);
   links->insert({name, this});
 
   XBT_DEBUG("Create link '%s'",name);
@@ -193,7 +193,6 @@ Link::Link(NetworkModel *model, const char *name, xbt_dict_t props,
 : Resource(model, name, props, constraint),
   p_latEvent(NULL)
 {
-  surf_callback_emit(networkLinkCreatedCallbacks, this);
   if (state_trace)
     p_stateEvent = tmgr_history_add_trace(history, state_trace, 0.0, 0, this);