diff --git a/Mesh/meshGFace.cpp b/Mesh/meshGFace.cpp
index 5345a11cbac9b28a5e9cbeb0f28250466cec9c63..539e0d3f113cc68b5b30da3b5f1aa78819d47b87 100644
--- a/Mesh/meshGFace.cpp
+++ b/Mesh/meshGFace.cpp
@@ -747,13 +747,15 @@ static bool meshGenerator(GFace *gf, int RECUR_ITER,
       ++itt;
     }
   }
-  Octree * _octree = buildMElementOctree(gf->model());
+
   if (Msg::GetVerbosity() == 10){
+    Octree *_octree = buildMElementOctree(gf->model());
     doc.Voronoi();
     doc.makePosView("voronoi.pos", gf);
     doc.printMedialAxis(_octree, "skeleton.pos", gf);
+    Octree_Delete(_octree);
   }
-  Octree_Delete(_octree);
+
   gf->triangles.clear();
   gf->quadrangles.clear();