fixed a memory leak
authorYanhuaSun <sun51@illinois.edu>
Sat, 24 Sep 2011 19:36:50 +0000 (14:36 -0500)
committerYanhuaSun <sun51@illinois.edu>
Sat, 24 Sep 2011 19:36:50 +0000 (14:36 -0500)
examples/converse/pingpong_multi/pingpong.C

index 1f32263c6f89032edabdb6cb90b3330dcaf680f0..66cd5b530bf532788b46e92e1397175449ef535e 100644 (file)
@@ -9,7 +9,7 @@
 #include <stdlib.h>
 #include <converse.h>
 
-enum {nCycles =3};
+enum {nCycles =4096};
 enum { maxMsgSize = 1 << 22 };
 
 CpvDeclare(int,msgSize);
@@ -87,6 +87,10 @@ CmiHandler exitHandlerFunc(char *msg)
 {
     CmiFree(msg);
     CsdExitScheduler();
+#if REUSE_MSG
+    if(CmiMyPe() ==0)
+        free(recvMsgs);
+#endif
     return 0;
 }