diff --git a/Mesh/Makefile b/Mesh/Makefile
index 5e8e9bcfb9ffdf3ce7cc6eea23cf3f64e310975f..39ee4e2089e7cabae289668e864edf415ec5d233 100644
--- a/Mesh/Makefile
+++ b/Mesh/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.155 2006-12-16 14:37:20 geuzaine Exp $
+# $Id: Makefile,v 1.156 2006-12-16 15:48:51 geuzaine Exp $
 #
 # Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 #
@@ -101,7 +101,11 @@ meshGEdge.o: meshGEdge.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../Geo/SVector3.h ../Numeric/Numeric.h ../Common/Context.h \
   ../Geo/ExtrudeParams.h ../Geo/GFace.h ../Geo/GPoint.h ../Geo/GEntity.h \
   ../Geo/GEdgeLoop.h ../Geo/GEdge.h ../Geo/MElement.h ../Geo/SPoint2.h \
-  ../Geo/SVector3.h ../Geo/Pair.h ../Geo/ExtrudeParams.h BackgroundMesh.h
+  ../Geo/SVector3.h ../Geo/Pair.h ../Geo/ExtrudeParams.h ../Geo/MRep.h \
+  ../Geo/GEdge.h ../Geo/GFace.h ../Geo/GRegion.h ../Geo/GEntity.h \
+  ../Geo/MElement.h ../Geo/ExtrudeParams.h ../Geo/MVertex.h \
+  ../Geo/MEdge.h ../Geo/MElement.h ../Common/VertexArray.h ../Common/OS.h \
+  BackgroundMesh.h
 meshGEdgeExtruded.o: meshGEdgeExtruded.cpp ../Geo/ExtrudeParams.h \
   ../Geo/GModel.h ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/Range.h \
   ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \
diff --git a/Mesh/meshGEdge.cpp b/Mesh/meshGEdge.cpp
index ec0c2c0cbba1ac9dc7c37a901b4049eb0eedde22..ccb2282aaefdceb675e058f651e169e4f86c2a65 100644
--- a/Mesh/meshGEdge.cpp
+++ b/Mesh/meshGEdge.cpp
@@ -1,4 +1,4 @@
-// $Id: meshGEdge.cpp,v 1.24 2006-12-05 14:22:05 remacle Exp $
+// $Id: meshGEdge.cpp,v 1.25 2006-12-16 15:48:51 geuzaine Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -23,6 +23,7 @@
 #include "meshGEdge.h"
 #include "GEdge.h"
 #include "GFace.h"
+#include "MRep.h"
 #include "BackgroundMesh.h"
 #include "Context.h"
 #include "Message.h"
@@ -193,6 +194,7 @@ void deMeshGEdge :: operator() (GEdge *ge)
   ge->mesh_vertices.clear();
   for (unsigned int i=0;i<ge->lines.size();i++) delete ge->lines[i];
   ge->lines.clear();
+  if(ge->meshRep) ge->meshRep->destroy();
 }
 
 void meshGEdge :: operator() (GEdge *ge)