Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove MSG. Its EOL was scheduled for 2020
[simgrid.git] / src / kernel / activity / MailboxImpl.cpp
index 7ee160c..7bbb815 100644 (file)
@@ -1,10 +1,9 @@
-/* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2023. 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. */
 
 #include "src/kernel/activity/MailboxImpl.hpp"
-#include "simgrid/msg.h"
 #include "src/kernel/activity/CommImpl.hpp"
 
 #include <unordered_map>
@@ -21,7 +20,11 @@ unsigned MailboxImpl::next_id_ = 0;
 
 MailboxImpl::~MailboxImpl()
 {
-  clear(false);
+  try {
+    clear(false);
+  } catch (const std::bad_alloc& ba) {
+    XBT_ERROR("MailboxImpl::clear() failure: %s", ba.what());
+  }
   set_receiver(nullptr);
 }