]> AND Public Git Repository - simgrid.git/blobdiff - examples/s4u/mc-failing-assert/s4u-mc-failing-assert.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Pointer-to-const for sonar.
[simgrid.git] / examples / s4u / mc-failing-assert / s4u-mc-failing-assert.cpp
index fb78611cee0fcb21d9f24dfcb7944c041b3aaa68..4ae9710c33c47b34b8a69ca0def5b95b1ec371ca 100644 (file)
@@ -18,9 +18,8 @@ static int server(int worker_amount)
   int value_got             = -1;
   simgrid::s4u::Mailbox* mb = simgrid::s4u::Mailbox::by_name("server");
   for (int count = 0; count < worker_amount; count++) {
-    const auto* msg = static_cast<int*>(mb->get());
+    auto msg  = mb->get_unique<int>();
     value_got = *msg;
-    delete msg;
   }
   /*
    * We assert here that the last message we got (which overwrite any previously received message) is the one from the