Skip to content

Commit

Permalink
Fix: fix memory leak in ClusterVisualizer
Browse files Browse the repository at this point in the history
Special care has to be taken when handling ClustersData objects. They
contain a o2::mergers::MergeInterface object which needs to be deleted
explicitly. Wrapping the ClustersData object which is pulled from CCDB
ensures the memory is appropiately freed at the end of update method.
  • Loading branch information
ariedel-cern authored and wiechula committed Oct 28, 2024
1 parent 8b8b98e commit 7dcabcf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Modules/TPC/src/ClusterVisualizer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ void ClusterVisualizer::update(Trigger t, framework::ServiceRegistryRef)

auto calDetIter = 0;

auto clusterData = mCdbApi.retrieveFromTFileAny<ClustersData>(mPath,
mLookupMaps.size() > 1 ? mLookupMaps.at(calDetIter) : mLookupMaps.at(0),
mTimestamps.size() > 0 ? mTimestamps.at(calDetIter) : t.timestamp);
std::unique_ptr<ClustersData> clusterData(mCdbApi.retrieveFromTFileAny<ClustersData>(mPath,
mLookupMaps.size() > 1 ? mLookupMaps.at(calDetIter) : mLookupMaps.at(0),
mTimestamps.size() > 0 ? mTimestamps.at(calDetIter) : t.timestamp));

auto& clusters = clusterData->getClusters();

Expand Down

0 comments on commit 7dcabcf

Please sign in to comment.