]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move some destructor code inside a try block. 6131/head
authorDavid Wells <wellsd2@rpi.edu>
Sat, 31 Mar 2018 20:13:59 +0000 (16:13 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Sat, 31 Mar 2018 20:13:59 +0000 (16:13 -0400)
This was caught by coverity.

source/base/timer.cc

index 3f0b4adf07c2e27c30bf25b48a2cc2d438932f69..97c213483aacbdc510b86dffe806d3d31c0ab353 100644 (file)
@@ -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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.