Index: ../trunk-jpl/src/m/contrib/gravity/vfsa.cpp
===================================================================
--- ../trunk-jpl/src/m/contrib/gravity/vfsa.cpp	(revision 18460)
+++ ../trunk-jpl/src/m/contrib/gravity/vfsa.cpp	(revision 18461)
@@ -426,6 +426,22 @@
 	}
 	savefile1.close();
 	savefile2.close();
+
+	delete m_old;
+	delete m_min;
+	delete m_new;
+	delete Pobs;
+	delete Pp;
+	delete Rho;
+	delete rho1;
+	delete rho2;
+	delete xobs;
+	delete yobs;
+	delete mesh_ini;
+	delete bathy;
+	delete icethick;
+	delete evalid;
+
 			/*}}}*/
 	return 0;
 }/*}}}*/
@@ -538,7 +554,7 @@
 	msplit(m0,m1,m2,dlevel);
 	
 	/*Multithreaded core*/
-	int       num_threads = 4;
+	int       num_threads = 8;
 	AppStruct usr;
 	usr.g = g1;
 	usr.Pobs = Pobs;
@@ -580,6 +596,18 @@
 		b=b+fabs(evalid->GetValue(i,0)*(gobs->GetValue(i,0)+g->GetValue(i,0)));
 	}
 	e=2*a/(a+b);
+
+	delete m1;
+	delete m2;
+	delete g1;
+	delete g2;
+	delete g;
+	delete gcalgr;
+	delete gcalvec;
+	delete df;
+	delete G;
+	delete M;
+
 	return e;
 }/*}}}*/
 void newmodelgen(Matrix* m0,Matrix* m1,Matrix* bathy,Matrix* icethick,int mx,int my,double T,double ptval,double mmax,double mmax2,double ctr,double sd){/*{{{*/
