From 788ac2c8a87331c2d984551e27b23d34ec0e2c03 Mon Sep 17 00:00:00 2001 From: Rebecca Cox Date: Fri, 8 Sep 2017 09:18:11 +0200 Subject: [PATCH] #1727 Reload summary case: A new file reader will be created on reload --- .../FileInterface/RifReaderEclipseSummary.cpp | 15 +++++---------- .../FileInterface/RifReaderEclipseSummary.h | 1 - .../ReservoirDataModel/RigSummaryCaseData.cpp | 9 +-------- 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/ApplicationCode/FileInterface/RifReaderEclipseSummary.cpp b/ApplicationCode/FileInterface/RifReaderEclipseSummary.cpp index d6eca0977e..d826d24ba2 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseSummary.cpp +++ b/ApplicationCode/FileInterface/RifReaderEclipseSummary.cpp @@ -41,7 +41,11 @@ RifReaderEclipseSummary::RifReaderEclipseSummary() //-------------------------------------------------------------------------------------------------- RifReaderEclipseSummary::~RifReaderEclipseSummary() { - close(); + if (m_ecl_sum) + { + ecl_sum_free(m_ecl_sum); + m_ecl_sum = NULL; + } } //-------------------------------------------------------------------------------------------------- @@ -87,15 +91,6 @@ bool RifReaderEclipseSummary::open(const std::string& headerFileName, const std: //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RifReaderEclipseSummary::close() -{ - if (m_ecl_sum) - { - ecl_sum_free(m_ecl_sum); - m_ecl_sum = NULL; - } -} - RifEclipseSummaryAddress addressFromErtSmSpecNode(const smspec_node_type * ertSumVarNode) { if ( smspec_node_get_var_type(ertSumVarNode) == ECL_SMSPEC_INVALID_VAR diff --git a/ApplicationCode/FileInterface/RifReaderEclipseSummary.h b/ApplicationCode/FileInterface/RifReaderEclipseSummary.h index cfc930c51b..e4170447be 100644 --- a/ApplicationCode/FileInterface/RifReaderEclipseSummary.h +++ b/ApplicationCode/FileInterface/RifReaderEclipseSummary.h @@ -41,7 +41,6 @@ public: ~RifReaderEclipseSummary(); bool open(const std::string& headerFileName, const std::vector& dataFileNames); - void close(); bool hasAddress(const RifEclipseSummaryAddress& resultAddress); const std::vector& allResultAddresses(); diff --git a/ApplicationCode/ReservoirDataModel/RigSummaryCaseData.cpp b/ApplicationCode/ReservoirDataModel/RigSummaryCaseData.cpp index 9b2eafd4e0..54b9d8e2b7 100644 --- a/ApplicationCode/ReservoirDataModel/RigSummaryCaseData.cpp +++ b/ApplicationCode/ReservoirDataModel/RigSummaryCaseData.cpp @@ -50,14 +50,7 @@ void RigSummaryCaseData::openOrReloadCase(const QString& summaryHeaderFileName) std::string nativeSumHeadFileName = QDir::toNativeSeparators(summaryHeaderFileName).toStdString(); RifEclipseSummaryTools::findSummaryFiles(nativeSumHeadFileName, &headerFileName, &dataFileNames); - if (m_summaryFileReader.isNull()) - { - m_summaryFileReader = new RifReaderEclipseSummary(); - } - else - { - m_summaryFileReader->close(); - } + m_summaryFileReader = new RifReaderEclipseSummary(); if (!m_summaryFileReader->open(headerFileName, dataFileNames)) {