From 9d83aefeca6a69755b5d257c7772664e97854c24 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@uliege.be>
Date: Fri, 6 May 2022 12:24:10 +0200
Subject: [PATCH] fix missing deallocation of condnumbasis (cf. #1913)

---
 CHANGELOG.txt                | 2 +-
 src/numeric/BasisFactory.cpp | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d549f25a34..bc965d74c9 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,5 +1,5 @@
 4.10.2 (Work-in-progress): fixed regression introduced in 4.9 for recombined
-meshes with boundary layers.
+meshes with boundary layers; small bug fixes.
 
 4.10.1 (May 1, 2022): small bug fixes.
 
diff --git a/src/numeric/BasisFactory.cpp b/src/numeric/BasisFactory.cpp
index 0919b2a5fe..81e0916f22 100644
--- a/src/numeric/BasisFactory.cpp
+++ b/src/numeric/BasisFactory.cpp
@@ -163,6 +163,13 @@ void BasisFactory::clearAll()
   }
   js.clear();
 
+  auto itC = cs.begin();
+  while(itC != cs.end()) {
+    delete itC->second;
+    itC++;
+  }
+  cs.clear();
+
   auto itG = gs.begin();
   while(itG != gs.end()) {
     delete itG->second;
-- 
GitLab