]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Do say if there is no additional information. Move code under an if() statement as...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 17 Jul 2013 14:36:21 +0000 (14:36 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 17 Jul 2013 14:36:21 +0000 (14:36 +0000)
git-svn-id: https://svn.dealii.org/trunk@30023 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/base/subscriptor.cc

index 17278853fae2a7d8098ea23a006a788c166281b9..0100b1d3149851068c3e0d7a2e72daf44c090b1e 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2010, 2012 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2010, 2012, 2013 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -69,13 +69,6 @@ Subscriptor::~Subscriptor ()
   // running the c++filt program over
   // the output.
 #ifdef DEBUG
-  std::string infostring;
-  for (map_iterator it = counter_map.begin(); it != counter_map.end(); ++it)
-    {
-      if (it->second > 0)
-        infostring += std::string("\n  from Subscriber ")
-                      + std::string(it->first);
-    }
 
   // if there are still active pointers, show
   // a message and kill the program. However,
@@ -99,6 +92,17 @@ Subscriptor::~Subscriptor ()
     {
       if (std::uncaught_exception() == false)
         {
+         std::string infostring;
+         for (map_iterator it = counter_map.begin(); it != counter_map.end(); ++it)
+           {
+             if (it->second > 0)
+               infostring += std::string("\n  from Subscriber ")
+                             + std::string(it->first);
+           }
+
+         if (infostring == "")
+           infostring = "<none>";
+         
           Assert (counter == 0,
                   ExcInUse (counter, object_info->name(), infostring));
         }

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.