From 7c4e52477e1ca5e8ed88d5a4016cc021d5477831 Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 17 Jul 2013 14:36:21 +0000 Subject: [PATCH] Do say if there is no additional information. Move code under an if() statement as well. git-svn-id: https://svn.dealii.org/trunk@30023 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/base/subscriptor.cc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/deal.II/source/base/subscriptor.cc b/deal.II/source/base/subscriptor.cc index 17278853fa..0100b1d314 100644 --- a/deal.II/source/base/subscriptor.cc +++ b/deal.II/source/base/subscriptor.cc @@ -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 = ""; + Assert (counter == 0, ExcInUse (counter, object_info->name(), infostring)); } -- 2.39.5