Skip to content

Commit

Permalink
Merge pull request #6107 from gassmoeller/improve_manager_base
Browse files Browse the repository at this point in the history
Do not throw in destructor of ManagerBase during stack unwinding
  • Loading branch information
bangerth authored Oct 23, 2024
2 parents 9d48875 + 2599c6f commit 528b304
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 528b304

Please sign in to comment.