Index: /issm/trunk-jpl/src/c/shared/Random/random.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Random/random.cpp	(revision 26656)
+++ /issm/trunk-jpl/src/c/shared/Random/random.cpp	(revision 26657)
@@ -26,5 +26,7 @@
 	/*Normal distribution*/
 	rnd::normal_distribution distriNormal(mean,sdev);
+	/*Assign output pointer and cleanup*/
 	*prand = distriNormal.generator(randomengine);
+	randomengine.free_resources();
 } /*}}}*/
 void multivariateNormal(IssmDouble** prand, int dim, IssmDouble mean, IssmDouble* covariancematrix, int seed=-1) { /*{{{*/
@@ -59,4 +61,5 @@
    xDelete<IssmPDouble>(sampleStandardNormal);
    xDelete<IssmDouble>(Lchol);
+	randomengine.free_resources();
 } /*}}}*/
 void multivariateNormal(IssmDouble** prand, int dim, IssmDouble* mean, IssmDouble* covariancematrix, int seed=-1) { /*{{{*/
@@ -90,4 +93,5 @@
 	xDelete<IssmPDouble>(sampleStandardNormal);
 	xDelete<IssmDouble>(Lchol);
+	randomengine.free_resources();
 } /*}}}*/
 
