Jacobi 3D: Don't leak memory for ghost elements at every step
[charm.git] / examples / charm++ / jacobi3d-sdag / jacobi3d.C
index 2f2666463e6a5dc6f388aa92c51d4c77719d746f..fe54575eb74ba0a2fdd84774076839129191c5b6 100644 (file)
@@ -250,6 +250,13 @@ class Jacobi: public CBase_Jacobi {
       // Send my back face
       thisProxy(thisIndex.x, thisIndex.y, wrap_z(thisIndex.z+1))
          .receiveGhosts(iterations, FRONT, blockDimX, blockDimY, backGhost);
+
+      delete[] leftGhost;
+      delete[] rightGhost;
+      delete[] bottomGhost;
+      delete[] topGhost;
+      delete[] frontGhost;
+      delete[] backGhost;
     }
 
     void processGhosts(int dir, int height, int width, double gh[]) {