From 3af21ae5c7cbfef9f09754135bf048fcc1dfd4ef Mon Sep 17 00:00:00 2001
From: Michel Rasquin <michel.rasquin@cenaero.be>
Date: Fri, 29 Jan 2016 10:42:46 +0000
Subject: [PATCH] Keep essential objects for multiple calls to gmsh lib. In
 particular, do not delete PViewOptions::reference() and CTX::instance().

---
 Common/Gmsh.cpp | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/Common/Gmsh.cpp b/Common/Gmsh.cpp
index 8b21e4b16f..83b2de8145 100644
--- a/Common/Gmsh.cpp
+++ b/Common/Gmsh.cpp
@@ -240,17 +240,12 @@ int GmshFinalize()
   
   // Delete static _interpolationSchemes of PViewData class
   PViewData::removeAllInterpolationSchemes();
-
-  // Delete static _reference of PViewOptions class
-  delete PViewOptions::reference();
 #endif
   // Delete all Gmodels
   for(unsigned int i = 0; i < GModel::list.size(); i++)
     delete GModel::list[i];
   GModel::list.clear();
-  
-  // Delete CTX instance
-  delete CTX::instance();
+
   return 1;
 }
 
-- 
GitLab