From: Martin Kronbichler Date: Thu, 4 Feb 2010 08:08:18 +0000 (+0000) Subject: Undo free of static variable. X-Git-Tag: v8.0.0~6557 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a92ff550937e1eeef0c5e7e526b03bf2aca15e0;p=dealii.git Undo free of static variable. git-svn-id: https://svn.dealii.org/trunk@20490 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/polynomial.h b/deal.II/base/include/base/polynomial.h index 9a840f0cad..8eda982788 100644 --- a/deal.II/base/include/base/polynomial.h +++ b/deal.II/base/include/base/polynomial.h @@ -404,11 +404,6 @@ namespace Polynomials */ Legendre (const unsigned int p); - /** - * Destructor. - */ - ~Legendre(); - /** * Return a vector of Legendre * polynomial objects of degrees diff --git a/deal.II/base/source/polynomial.cc b/deal.II/base/source/polynomial.cc index d4259788ca..2d864be150 100644 --- a/deal.II/base/source/polynomial.cc +++ b/deal.II/base/source/polynomial.cc @@ -727,29 +727,6 @@ namespace Polynomials - Legendre::~Legendre () - { - // need to free the memory that was allocated - // when recursive coefficients are calculated. - Threads::ThreadMutex::ScopedLock lock(coefficients_lock); - for (unsigned int i=0; i *c0 = 0; - std::swap (recursive_coefficients[i], c0); - delete c0; - } - for (unsigned int i=0; i *c0 = 0; - std::swap (shifted_coefficients[i], c0); - delete c0; - } - } - - - void Legendre::compute_coefficients (const unsigned int k_) { @@ -810,16 +787,16 @@ namespace Polynomials // Compute polynomials // orthogonal on [0,1] - std::vector *d0 = new std::vector(*c0); - std::vector *d1 = new std::vector(*c1); - - Polynomial::shift (*d0, -1.); - Polynomial::scale(*d0, 2.); - Polynomial::shift (*d1, -1.); - Polynomial::scale(*d1, 2.); - Polynomial::multiply(*d1, std::sqrt(3.)); - shifted_coefficients[0]=d0; - shifted_coefficients[1]=d1; + c0 = new std::vector(*c0); + c1 = new std::vector(*c1); + + Polynomial::shift (*c0, -1.); + Polynomial::scale(*c0, 2.); + Polynomial::shift (*c1, -1.); + Polynomial::scale(*c1, 2.); + Polynomial::multiply(*c1, std::sqrt(3.)); + shifted_coefficients[0]=c0; + shifted_coefficients[1]=c1; } else {