Use make_unique to create unique_ptrs with exception safety.

This commit is contained in:
Markus Blatt 2020-08-18 09:36:33 +02:00
parent 75104fd310
commit 1300139eea

View File

@ -351,8 +351,8 @@ public:
} }
else else
eclSchedule_ = externalEclSchedule_.get(); eclSchedule_ = externalEclSchedule_.get();
this->summaryState_.reset( new Opm::SummaryState( std::chrono::system_clock::from_time_t(this->eclSchedule_->getStartTime() ))); this->summaryState_ = std::make_unique<Opm::SummaryState>( std::chrono::system_clock::from_time_t(this->eclSchedule_->getStartTime() ));
this->actionState_.reset( new Opm::Action::State() ); this->actionState_ = std::make_unique<Opm::Action::State>() ;
if (!externalEclSummaryConfig_) { if (!externalEclSummaryConfig_) {
// create the schedule object. Note that if eclState is supposed to represent // create the schedule object. Note that if eclState is supposed to represent