Skip to content

Commit

Permalink
Fixed the memory leak. Refs #7506.
Browse files Browse the repository at this point in the history
Memory leak is caused by mistakenly using ws.dataX(spectrum), which
causes a copy operatoin on vector, other than ws.readX(spectrum).
As it is not threading safe, the memory leak occurs.
  • Loading branch information
wdzhou committed Jul 29, 2013
1 parent 56a273d commit 567c58d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/Algorithms/src/FindPeaks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1202,8 +1202,8 @@ namespace Algorithms
const int& i_centre, const int& i_min, const int& i_max,
double& in_bg0, double& in_bg1, double& in_bg2)
{
g_log.notice() << "Fitting a peak assumed at " << input->dataX(spectrum)[i_centre]
<< " (index = " << i_centre << ") by high-background approach. \n";
g_log.notice() << "Fitting a peak assumed at " << input->readX(spectrum)[i_centre]
<< " (index = " << i_centre << ") by high-background approach. \n";

// Check
if (i_min >= i_centre || i_max <= i_centre || i_min < 0)
Expand Down

0 comments on commit 567c58d

Please sign in to comment.