From 7cadf2ade1f3563d95c3bfc63ade0482460bef52 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 31 Mar 2018 16:13:59 -0400 Subject: [PATCH] Move some destructor code inside a try block. This was caught by coverity. --- source/base/timer.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/base/timer.cc b/source/base/timer.cc index 3f0b4adf07..97c213483a 100644 --- a/source/base/timer.cc +++ b/source/base/timer.cc @@ -355,13 +355,14 @@ TimerOutput::~TimerOutput() { while (active_sections.size() > 0) leave_subsection(); + // don't print unless we leave all subsections + if ((output_frequency == summary || + output_frequency == every_call_and_summary) + && output_is_enabled == true) + print_summary(); } catch (...) {} - - if ( (output_frequency == summary || output_frequency == every_call_and_summary) - && output_is_enabled == true) - print_summary(); }; // avoid communicating with other processes if there is an uncaught -- 2.39.5