In lines 61-63 in RapidExternalEvtGen.cc
while(theParticle->getNDaug()==1) {
theParticle = theParticle->getDaug(0);
}
the pointer gets overwritten with the final state of the meson, without however making sure the first state is properly deleted, thus creating a memory leak. Suggest to update the while loop to:
while(theParticle->getNDaug()==1) {
EvtParticle* originalState = theParticle;
theParticle = theParticle->getDaug(0);
delete originalState;
}
In lines 61-63 in RapidExternalEvtGen.cc
while(theParticle->getNDaug()==1) {theParticle = theParticle->getDaug(0);}the pointer gets overwritten with the final state of the meson, without however making sure the first state is properly deleted, thus creating a memory leak. Suggest to update the while loop to:
while(theParticle->getNDaug()==1) {EvtParticle* originalState = theParticle;theParticle = theParticle->getDaug(0);delete originalState;}