From 652f3e76e7c497465634ed4ddb9547e160b3abbf Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 26 Aug 2022 15:23:21 +0200 Subject: [PATCH] Don't throw an exception from destructor. boost::circular_buffer_space_optimized::pop_back() may throw std::bad_alloc --- src/kernel/activity/MailboxImpl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/kernel/activity/MailboxImpl.cpp b/src/kernel/activity/MailboxImpl.cpp index 7ee160c332..b73838178e 100644 --- a/src/kernel/activity/MailboxImpl.cpp +++ b/src/kernel/activity/MailboxImpl.cpp @@ -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); } -- 2.20.1