[Gridflow-cvs] [svn] commit: r3666 - /trunk/base/flow_objects.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Fri Apr 25 23:07:22 EDT 2008


Author: matju
Date: Fri Apr 25 23:07:21 2008
New Revision: 3666

Log:
fix leak in deleting [#store]

Modified:
    trunk/base/flow_objects.c

Modified: trunk/base/flow_objects.c
==============================================================================
--- trunk/base/flow_objects.c (original)
+++ trunk/base/flow_objects.c Fri Apr 25 23:07:21 2008
@@ -375,9 +375,6 @@
 	PtrGrid r; // can't be \attr
 	PtrGrid put_at; // can't be //\attr
 	\attr Numop *op;
-	//int32 wdex [Dim::MAX_DIM]; // temporary buffer, copy of put_at
-	//int32 fromb[Dim::MAX_DIM];
-	//int32 to2  [Dim::MAX_DIM];
 	int32 *wdex ; // temporary buffer, copy of put_at
 	int32 *fromb;
 	int32 *to2  ;
@@ -390,6 +387,11 @@
 		wdex  = new int32[Dim::MAX_DIM]; // temporary buffer, copy of put_at
 		fromb = new int32[Dim::MAX_DIM];
 		to2   = new int32[Dim::MAX_DIM];
+	}
+	~GridStore () {
+		delete[] wdex;
+		delete[] fromb;
+		delete[] to2;
 	}
 	\decl 0 bang ();
 	\decl 1 reassign ();



More information about the Gridflow-cvs mailing list