[MOAB-dev] commit/MOAB: iulian07: valgrind find and typo in TupleList
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Feb 13 15:16:31 CST 2014
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/d84a8be5b9ec/
Changeset: d84a8be5b9ec
Branch: master
User: iulian07
Date: 2014-02-13 22:12:47
Summary: valgrind find and typo in TupleList
for intersection test, valgrind reported a memory leak
that memory is cleaned in destructor now
in TupleList, wrong size was used in reporting reallocation error
Affected #: 2 files
diff --git a/src/TupleList.cpp b/src/TupleList.cpp
index bf08946..113e826 100644
--- a/src/TupleList.cpp
+++ b/src/TupleList.cpp
@@ -50,7 +50,7 @@ void TupleList::buffer::buffer_reserve_(size_t min, const char *file)
newSize = min;
void *res = realloc(ptr, newSize);
if (!res && newSize > 0)
- fail("%s: allocation of %d bytes failed\n", file, (int) this->buffSize);
+ fail("%s: reallocation of %d bytes failed\n", file, newSize);
ptr = (char*) res;
this->buffSize = newSize;
}
diff --git a/tools/mbcslam/Intx2Mesh.cpp b/tools/mbcslam/Intx2Mesh.cpp
index 311bfd4..22fdc3f 100644
--- a/tools/mbcslam/Intx2Mesh.cpp
+++ b/tools/mbcslam/Intx2Mesh.cpp
@@ -33,6 +33,11 @@ Intx2Mesh::Intx2Mesh(Interface * mbimpl): mb(mbimpl), parcomm(NULL), remote_cell
Intx2Mesh::~Intx2Mesh()
{
// TODO Auto-generated destructor stub
+ if (remote_cells)
+ {
+ delete remote_cells;
+ remote_cells=NULL;
+ }
}
void Intx2Mesh::createTags()
{
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