diff --git a/DDG4/hepmc/HepMC3FileReader.cpp b/DDG4/hepmc/HepMC3FileReader.cpp index b94897abe..9e0f36daf 100644 --- a/DDG4/hepmc/HepMC3FileReader.cpp +++ b/DDG4/hepmc/HepMC3FileReader.cpp @@ -133,8 +133,8 @@ HEPMC3FileReader::HEPMC3FileReader(const std::string& nam) m_reader->skip(1); // then we get the run info (shared pointer) auto runInfo = m_reader->run_info(); - // and close the reader - m_reader->close(); + // and deallocate the reader + m_reader.reset(); // so we can open the file again from the start m_reader = HepMC3::deduce_reader(nam); // and set the run info object now