Skip to content

Avoid double delete in THistSvc::finalize

The logic that allows regHist to take multiple histograms with the same name leads to a double delete in :

  for ( auto& obj : m_tobjs ) {
    // TObject*'s are already dealt with through root file i/o
    delete obj.second.first; // delete vhid*

because multiple elements of the map m_tobjs share the same obj.second.first, which is a std::vector<THistID>*. This fix will only delete the pointer for the "first" occurrence.

Merge request reports