[MOAB-dev] commit/MOAB: iulian07: memory management bug

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Oct 24 12:02:08 CDT 2013


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/57427173f201/
Changeset:   57427173f201
Branch:      master
User:        iulian07
Date:        2013-10-24 18:50:01
Summary:     memory management bug

the MBZoltan object was not cleared correctly, and it crashed
when we deleted it; (I did not NULL the zoltan object pointer)

Affected #:  2 files

diff --git a/src/io/NCHelperMPAS.cpp b/src/io/NCHelperMPAS.cpp
index 80f3a1e..269312c 100644
--- a/src/io/NCHelperMPAS.cpp
+++ b/src/io/NCHelperMPAS.cpp
@@ -987,7 +987,7 @@ ErrorCode NCHelperMPAS::redistribute_local_cells(int start_cell_idx)
     DebugOutput& dbgOut = _readNC->dbgOut;
     MBZoltan* mbZTool = new MBZoltan(mbImpl, false, 0, NULL);
     ErrorCode rval = mbZTool->repartition(xCell, yCell, zCell, start_cell_idx, "RCB", localGidCells);
-    //delete mbZTool;
+    delete mbZTool;
     ERRORR(rval, "Error in Zoltan partitioning.");
 
     dbgOut.tprintf(1, "After Zoltan partitioning, localGidCells.psize() = %d\n", (int)localGidCells.psize());

diff --git a/tools/mbzoltan/MBZoltan.cpp b/tools/mbzoltan/MBZoltan.cpp
index e598f0e..6b92b4f 100644
--- a/tools/mbzoltan/MBZoltan.cpp
+++ b/tools/mbzoltan/MBZoltan.cpp
@@ -342,6 +342,7 @@ ErrorCode  MBZoltan::repartition(std::vector<double> & x,std::vector<double>&y,
     sendToProcs.push_back(assign_procs[i]);
   // free some memory after we are done
   delete myZZ;
+  myZZ = NULL;
   // free memory used by Zoltan
   // form tuples for Gids!
   TupleList gidProcs;

Repository URL: https://bitbucket.org/fathomteam/moab/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the moab-dev mailing list