Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't throw an exception from destructor.
[simgrid.git] / src / kernel / activity / MailboxImpl.cpp
index 7ee160c..b738381 100644 (file)
@@ -21,7 +21,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);
 }