From f186084682167eb2003c925afde80aee309cc99c Mon Sep 17 00:00:00 2001
From: Alexander Schmidt <alex@treefish.org>
Date: Thu, 28 Aug 2014 00:52:33 +0200
Subject: [PATCH] Destructing prestore.

---
 su2clebsch.cpp | 5 +++++
 su2clebsch.hpp | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/su2clebsch.cpp b/su2clebsch.cpp
index 11d506e..f809635 100644
--- a/su2clebsch.cpp
+++ b/su2clebsch.cpp
@@ -21,6 +21,11 @@ namespace su2clebsch {
     return result;
   }
 
+  prestore::~prestore ()
+  {
+    delete[] cgcdata;
+  }
+
   prestore::prestore(unsigned int _max2j) 
   {
     max2j = _max2j;
diff --git a/su2clebsch.hpp b/su2clebsch.hpp
index 87e01bf..955868c 100644
--- a/su2clebsch.hpp
+++ b/su2clebsch.hpp
@@ -1,6 +1,8 @@
 #ifndef SU2CLEBSCH_HPP
 #define SU2CLEBSCH_HPP
 
+using namespace std;
+
 namespace su2clebsch {
 
   struct prestore {
@@ -9,6 +11,7 @@ namespace su2clebsch {
     double *cgcdata;
   public:
     prestore(unsigned int _max2j);
+    ~prestore();
 
     friend double cgc (int factor1_2j, int factor1_2m, int factor2_2j, int factor2_2m,
 		       int irrep_2j, int irrep_2m, const prestore& Prestore);
-- 
2.39.5