Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Dig through git history, and update copyright lines.
[simgrid.git] / src / surf / ns3 / ns3_simulator.cc
index d0f68f2..d985d73 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -41,6 +41,12 @@ static XBT_INLINE void transformSocketPtr (Ptr<Socket> localSocket){
   sprintf(socket_key,"%s",s.c_str());
 }
 
+static void delete_mysocket(void *p)
+{
+  MySocket *sock = (MySocket *)p;
+  delete(sock);
+}
+
 /*
  * This function create a flow from src to dst
  *
@@ -61,7 +67,7 @@ void NS3Sim::create_flow_NS3(
                uint32_t totalBytes,
                void * action)
 {
-       if(!dict_socket) dict_socket = xbt_dict_new_homogeneous(free);
+       if(!dict_socket) dict_socket = xbt_dict_new_homogeneous(delete_mysocket);
 
        PacketSinkHelper sink ("ns3::TcpSocketFactory",
                                                        InetSocketAddress (Ipv4Address::GetAny(),