X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/813e836067a1aa922c5fb1432300b7e6390ee352..39c935d6d5ee86d153f6f7e6a10d723ae7c57f6f:/teshsuite/s4u/host-on-off-actors/host-on-off-actors.cpp diff --git a/teshsuite/s4u/host-on-off-actors/host-on-off-actors.cpp b/teshsuite/s4u/host-on-off-actors/host-on-off-actors.cpp index 011b7e85e6..4359ad76a5 100644 --- a/teshsuite/s4u/host-on-off-actors/host-on-off-actors.cpp +++ b/teshsuite/s4u/host-on-off-actors/host-on-off-actors.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2021. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -40,10 +40,9 @@ static void commTX() static void commRX() { - const std::string* payload = nullptr; XBT_INFO(" Start RX"); try { - payload = simgrid::s4u::Mailbox::by_name("comm")->get(); + auto payload = simgrid::s4u::Mailbox::by_name("comm")->get_unique(); XBT_INFO(" Receive message: %s", payload->c_str()); } catch (const simgrid::HostFailureException&) { XBT_INFO(" Receive message: HOST_FAILURE"); @@ -51,7 +50,6 @@ static void commRX() XBT_INFO(" Receive message: TRANSFER_FAILURE"); } - delete payload; XBT_INFO(" RX Done"); }