Skip to content
Snippets Groups Projects
Commit 032e95ab authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

Bugfix: It is wrong to use a shared_ptr for the TimeManager in

OneModelProblem, since the object can be owned by a different class.
This leads to a segfault at the end of test_transport. Therefore, a raw
pointer is taken for the moment. We should carefully rethink this in
general after the release. 
Discussed with Markus.


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@10278 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 1cd8f9c9
No related branches found
No related tags found
No related merge requests found
......@@ -107,7 +107,8 @@ public:
}
}
timeManager_ = Dune::make_shared<TimeManager>(verbose);
timeManager_ = new TimeManager(verbose);
newTimeManager_ = true;
model_ = Dune::make_shared<Model>(asImp_()) ;
}
......@@ -122,6 +123,7 @@ public:
bboxMin_(std::numeric_limits<double>::max()),
bboxMax_(-std::numeric_limits<double>::max()),
timeManager_(&timeManager),
newTimeManager_(false),
variables_(gridView),
outputInterval_(1)
{
......@@ -134,10 +136,17 @@ public:
bboxMax_[i] = std::max(bboxMax_[i], vIt->geometry().center()[i]);
}
}
model_ = Dune::make_shared<Model>(asImp_()) ;
}
//! Destructor
~OneModelProblem()
{
if (newTimeManager_)
delete timeManager_;
}
/*!
* \brief Specifies which kind of boundary condition should be
* used for which equation on a given boundary segment.
......@@ -626,7 +635,8 @@ private:
GlobalPosition bboxMin_;
GlobalPosition bboxMax_;
Dune::shared_ptr<TimeManager> timeManager_;
TimeManager *timeManager_;
bool newTimeManager_;
Variables variables_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment