Skip to content

Commit 89790cc

Browse files
committed
fixes memleak in ElementStateParameter.cpp
1 parent b47149d commit 89790cc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

SRC/domain/component/ElementStateParameter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ElementStateParameter::ElementStateParameter(int tag, double value,
3535
:Parameter(tag,PARAMETER_TAG_ElementStateParameter),
3636
currentValue(value),
3737
flag(Flag),
38-
argc(Argc), fromFree(1)
38+
argc(Argc), fromFree(0) // We own memory if this constructor is called
3939
{
4040
if (theEle != 0)
4141
theEleIDs = new ID(*theEle);
@@ -53,7 +53,7 @@ ElementStateParameter::ElementStateParameter()
5353
:Parameter(0,PARAMETER_TAG_ElementStateParameter),
5454
currentValue(0.0),
5555
theEleIDs(0), flag(0),
56-
argv(0), argc(0), fromFree(1)
56+
argv(0), argc(0), fromFree(0)
5757
{
5858

5959
}
@@ -195,7 +195,7 @@ ElementStateParameter::recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBr
195195
theChannel.recvVector(commitTag, 0, dData);
196196
currentValue = dData(0);
197197

198-
fromFree = 1;
198+
fromFree = 0;
199199

200200
if (theEleIDs != 0)
201201
delete theEleIDs;

0 commit comments

Comments
 (0)