Skip to content
Snippets Groups Projects

Avoid double delete in THistSvc::finalize

Merged Peter Onyisi requested to merge ponyisi/Gaudi:master-thistsvc-doubledelete into master

The logic that allows regHist to take multiple histograms with the same name leads to a double delete in https://gitlab.cern.ch/gaudi/Gaudi/-/blob/master/GaudiSvc/src/THistSvc/THistSvc.cpp#L328 :

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

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.

Edited by Peter Onyisi

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading