move delete of energy corrector in destructor
Merge pull request #2683 from matteosan1/topic_bugfix_photonproducer

move delete of energy corrector in destructor