Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
s4u-dht-chord: cancel pending comm.
[simgrid.git] / examples / s4u / dht-chord / s4u-dht-chord.hpp
index 04f0c22..a5fff65 100644 (file)
@@ -69,6 +69,8 @@ public:
   }
 
   ~ChordMessage() = default;
+
+  static void destroy(void* message);
 };
 
 class Node {
@@ -159,9 +161,9 @@ public:
       }
       now = simgrid::s4u::Engine::getClock();
     }
-    if (data != nullptr) {
-      delete static_cast<ChordMessage*>(data);
-    }
+    if (comm_receive != nullptr)
+      comm_receive->cancel();
+    delete static_cast<ChordMessage*>(data);
     // leave the ring
     leave();
   }