Skip to content

Commit

Permalink
Do not throw in destructor during unwinding
Browse files Browse the repository at this point in the history
  • Loading branch information
gassmoeller committed Oct 23, 2024
1 parent 4101744 commit 2599c6f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion include/aspect/plugins.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,16 @@ namespace aspect
template <typename InterfaceType>
ManagerBase<InterfaceType>::~ManagerBase()
{
Assert (plugin_names.size() == plugin_objects.size(), ExcInternalError());
// only check and throw if we are not unwinding the stack due
// to an active exception
#ifdef DEAL_II_HAVE_CXX17
if (std::uncaught_exceptions() == 0)
#else
if (std::uncaught_exception() == false)
#endif
{
Assert (plugin_names.size() == plugin_objects.size(), ExcInternalError());
}
}


Expand Down

0 comments on commit 2599c6f

Please sign in to comment.