Index: /issm/trunk-jpl/src/c/classes/gauss/GaussSeg.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/gauss/GaussSeg.cpp	(revision 16397)
+++ /issm/trunk-jpl/src/c/classes/gauss/GaussSeg.cpp	(revision 16398)
@@ -15,7 +15,19 @@
 GaussSeg::GaussSeg(int order){
 
+	IssmPDouble* pcoords1=NULL;
+	IssmPDouble* pweights=NULL;
+
 	/*Get gauss points*/
 	this->numgauss = order;
-	GaussLegendreLinear(&this->coords1,&this->weights,order);
+	GaussLegendreLinear(&pcoords1,&pweights,order);
+	
+	this->coords1=xNew<IssmDouble>(numgauss);
+	this->weights=xNew<IssmDouble>(numgauss);
+
+	/*cast : */
+	for(int i=0;i<numgauss;i++){
+		this->coords1[i]=pcoords1[i];
+		this->weights[i]=pweights[i];
+	}
 
 	/*Initialize static fields as undefinite*/
