Skip to content

Commit

Permalink
Update FitRWMWaveform.cpp
Browse files Browse the repository at this point in the history
delete histograms to prevent potential memory leakage
  • Loading branch information
S81D authored Oct 7, 2024
1 parent 958bf04 commit 3a54ce6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions UserTools/FitRWMWaveform/FitRWMWaveform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ bool FitRWMWaveform::Finalise()
hRWM->SetBinContent(i + 1, val[i]); // Note the 1-based index
}
hRWM->Write();
delete hRWM;
RWMCount++;
}

Expand All @@ -100,10 +101,12 @@ bool FitRWMWaveform::Finalise()
hBRF->SetBinContent(i + 1, val[i]); // Note the 1-based index
}
hBRF->Write();
delete hBRF;
BRFCount++;
}

fOutput_tfile->Close();
delete fOutput_tfile;
}

return true;
Expand Down

0 comments on commit 3a54ce6

Please sign in to comment.