Skip to content

Commit

Permalink
Fix dangling SUNContext pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Oct 19, 2024
1 parent 7de8483 commit 578f1d8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/cpp/unittests/testMisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,9 @@ TEST_F(SolverTest, SettersGettersWithSetup)
ASSERT_EQ(static_cast<int>(solver.getSensitivityMethod()),
static_cast<int>(sensi_meth));

sundials::Context sunctx;
auto rdata = std::make_unique<ReturnData>(solver, testModel);
AmiVector x(nx, sunctx), dx(nx, sunctx);
AmiVectorArray sx(nx, 1, sunctx), sdx(nx, 1, sunctx);
AmiVector x(nx, solver.getSunContext()), dx(nx, solver.getSunContext());
AmiVectorArray sx(nx, 1, solver.getSunContext()), sdx(nx, 1, solver.getSunContext());

testModel.setInitialStates(std::vector<realtype>{ 0 });

Expand Down

0 comments on commit 578f1d8

Please sign in to comment.