Skip to content

Commit 90c7f52

Browse files
author
Stefan Hoops
committed
Fixed Bug 2332. The relocation of event assignments does no longer create
an access violation.
1 parent d51a0a4 commit 90c7f52

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

copasi/math/CMathEvent.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,15 +1218,9 @@ void CMathEvent::relocate(const CMathContainer * pContainer,
12181218
pAssignment->relocate(pContainer, relocations);
12191219
}
12201220

1221-
if (mAssignments.size() > 0)
1222-
{
1223-
mTargetValues.initialize(mAssignments.size(),
1224-
(C_FLOAT64 *) mAssignments[0].getAssignment()->getValuePointer());
1225-
}
1226-
else
1227-
{
1228-
mTargetValues.initialize(0, NULL);
1229-
}
1221+
C_FLOAT64 * pArray = mTargetValues.array();
1222+
mpContainer->relocateValue(pArray, relocations);
1223+
mTargetValues.initialize(mAssignments.size(), pArray);
12301224

12311225
pContainer->relocateObject(mpDelay, relocations);
12321226
pContainer->relocateObject(mpPriority, relocations);

0 commit comments

Comments
 (0)