From 88f2e2921c861ba167cd6a08308cff6fc5538354 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 21 Feb 2005 06:19:34 +0000 Subject: [PATCH] Make UserClass destructor virtual. git-svn-id: https://svn.dealii.org/trunk@9904 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/parameter_handler.h | 10 +++++++++- deal.II/base/source/parameter_handler.cc | 6 +++++- deal.II/doc/news/changes.html | 8 ++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/deal.II/base/include/base/parameter_handler.h b/deal.II/base/include/base/parameter_handler.h index e190bee639..eea2440fb2 100644 --- a/deal.II/base/include/base/parameter_handler.h +++ b/deal.II/base/include/base/parameter_handler.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -1871,6 +1871,14 @@ class MultipleParameterLoop : public ParameterHandler class UserClass { public: + /** + * Destructor. It doesn't actually do + * anything, but is declared to force + * derived classes to have a virtual + * destructor. + */ + virtual ~UserClass (); + /** * create_new must provide a clean * object, either by creating a new one diff --git a/deal.II/base/source/parameter_handler.cc b/deal.II/base/source/parameter_handler.cc index 54a5918396..4709fc7b30 100644 --- a/deal.II/base/source/parameter_handler.cc +++ b/deal.II/base/source/parameter_handler.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -1340,6 +1340,10 @@ ParameterHandler::Section::memory_consumption () const +MultipleParameterLoop::UserClass::~UserClass () +{} + + MultipleParameterLoop::MultipleParameterLoop() : diff --git a/deal.II/doc/news/changes.html b/deal.II/doc/news/changes.html index 7ad07ce7b7..129ccbdf56 100644 --- a/deal.II/doc/news/changes.html +++ b/deal.II/doc/news/changes.html @@ -47,6 +47,14 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK

base

    +
  1. + Fixed: The class MultipleParameterLoop::UserClass had only + virtual abstract functions but no virtual destructor. This caused + warnings with some compilers, and is generally bad practice + anyway. This is now fixed. +
    + (WB, 2005/02/20) +

-- 2.39.5