Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Test comm before cancelation, and kill last leak in this test! \o/
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 27 Sep 2017 08:16:00 +0000 (10:16 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 27 Sep 2017 08:16:00 +0000 (10:16 +0200)
examples/s4u/dht-chord/s4u-dht-chord.hpp

index a5fff65..50e7f60 100644 (file)
@@ -161,9 +161,12 @@ public:
       }
       now = simgrid::s4u::Engine::getClock();
     }
       }
       now = simgrid::s4u::Engine::getClock();
     }
-    if (comm_receive != nullptr)
-      comm_receive->cancel();
-    delete static_cast<ChordMessage*>(data);
+    if (comm_receive != nullptr) {
+      if (comm_receive->test())
+        delete static_cast<ChordMessage*>(data);
+      else
+        comm_receive->cancel();
+    }
     // leave the ring
     leave();
   }
     // leave the ring
     leave();
   }