Skip to content

Commit

Permalink
Merge pull request #17803 from igv4321/minor-memory-leak-fix
Browse files Browse the repository at this point in the history
Proper memory cleanup
  • Loading branch information
cmsbuild committed Mar 14, 2017
2 parents 8b56735 + 5985ea6 commit 2e67002
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
6 changes: 5 additions & 1 deletion RecoLocalCalo/HcalRecAlgos/src/HcalSeverityLevelComputer.cc
Expand Up @@ -228,7 +228,11 @@ HcalSeverityLevelComputer::HcalSeverityLevelComputer( const edm::ParameterSet& i
} // HcalSeverityLevelComputer::HcalSeverityLevelComputer


HcalSeverityLevelComputer::~HcalSeverityLevelComputer() {}
HcalSeverityLevelComputer::~HcalSeverityLevelComputer()
{
delete DropChannel_;
delete RecoveredRecHit_;
}


int HcalSeverityLevelComputer::getSeverityLevel(const DetId& myid, const uint32_t& myflag,
Expand Down
15 changes: 12 additions & 3 deletions RecoLocalCalo/HcalRecProducers/src/ZdcHitReconstructor.cc
Expand Up @@ -22,6 +22,12 @@ ZdcHitReconstructor::ZdcHitReconstructor(edm::ParameterSet const& conf):
conf.getParameter<int>("recoMethod"),
conf.getParameter<int>("lowGainOffset"),
conf.getParameter<double>("lowGainFrac")),
saturationFlagSetter_(nullptr),
HFTimingTrustFlagSetter_(nullptr),
hbheHSCPFlagSetter_(nullptr),
hbheTimingShapedFlagSetter_(nullptr),
hfrechitbit_(nullptr),
hfdigibit_(nullptr),
det_(DetId::Hcal),
correctTiming_(conf.getParameter<bool>("correctTiming")),
setNoiseFlags_(conf.getParameter<bool>("setNoiseFlags")),
Expand All @@ -30,8 +36,8 @@ ZdcHitReconstructor::ZdcHitReconstructor(edm::ParameterSet const& conf):
setTimingTrustFlags_(conf.getParameter<bool>("setTimingTrustFlags")),
dropZSmarkedPassed_(conf.getParameter<bool>("dropZSmarkedPassed")),
AuxTSvec_(conf.getParameter<std::vector<int> >("AuxTSvec")),
myobject(0),
theTopology(0)
myobject(nullptr),
theTopology(nullptr)

{
tok_input_hcal = consumes<ZDCDigiCollection>(conf.getParameter<edm::InputTag>("digiLabelhcal"));
Expand Down Expand Up @@ -59,8 +65,11 @@ ZdcHitReconstructor::ZdcHitReconstructor(edm::ParameterSet const& conf):

}

ZdcHitReconstructor::~ZdcHitReconstructor() {;
ZdcHitReconstructor::~ZdcHitReconstructor()
{
delete saturationFlagSetter_;
}

void ZdcHitReconstructor::beginRun(edm::Run const&r, edm::EventSetup const & es){

edm::ESHandle<HcalLongRecoParams> p;
Expand Down

0 comments on commit 2e67002

Please sign in to comment.