Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FWCore/Framework/interface/stream/EDAnalyzerAdaptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace edm {
}
EDAnalyzerAdaptor(const EDAnalyzerAdaptor&) = delete; // stop default
const EDAnalyzerAdaptor& operator=(const EDAnalyzerAdaptor&) = delete; // stop default
~EDAnalyzerAdaptor() override {}
~EDAnalyzerAdaptor() override { deleteModulesEarly(); }

static void fillDescriptions(ConfigurationDescriptions& descriptions) { T::fillDescriptions(descriptions); }
static void prevalidate(ConfigurationDescriptions& descriptions) { T::prevalidate(descriptions); }
Expand Down
2 changes: 2 additions & 0 deletions FWCore/Framework/interface/stream/EDAnalyzerAdaptorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ namespace edm {

std::vector<ConsumesInfo> consumesInfo() const;

void deleteModulesEarly();

private:
bool doEvent(EventTransitionInfo const&, ActivityRegistry*, ModuleCallingContext const*);
void doPreallocate(PreallocationConfiguration const&);
Expand Down
2 changes: 1 addition & 1 deletion FWCore/Framework/interface/stream/ProducingModuleAdaptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace edm {
}
ProducingModuleAdaptor(const ProducingModuleAdaptor&) = delete; // stop default
const ProducingModuleAdaptor& operator=(const ProducingModuleAdaptor&) = delete; // stop default
~ProducingModuleAdaptor() override {}
~ProducingModuleAdaptor() override { this->deleteModulesEarly(); }

static void fillDescriptions(ConfigurationDescriptions& descriptions) { T::fillDescriptions(descriptions); }
static void prevalidate(ConfigurationDescriptions& descriptions) { T::prevalidate(descriptions); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ namespace edm {

const ProducerBase* producer() { return m_streamModules[0]; }

void deleteModulesEarly();

private:
void doPreallocate(PreallocationConfiguration const&);
virtual void preallocLumis(unsigned int) {}
Expand Down
7 changes: 7 additions & 0 deletions FWCore/Framework/src/stream/EDAnalyzerAdaptorBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ EDAnalyzerAdaptorBase::~EDAnalyzerAdaptorBase() {
}
}

void EDAnalyzerAdaptorBase::deleteModulesEarly() {
for (auto m : m_streamModules) {
delete m;
}
m_streamModules.clear();
}

//
// assignment operators
//
Expand Down
8 changes: 8 additions & 0 deletions FWCore/Framework/src/stream/ProducingModuleAdaptorBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ namespace edm {
}
}

template <typename T>
void ProducingModuleAdaptorBase<T>::deleteModulesEarly() {
for (auto m : m_streamModules) {
delete m;
}
m_streamModules.clear();
}

//
// member functions
//
Expand Down