Skip to content

Commit

Permalink
Re #5466. Clear a couple of memory leaks.
Browse files Browse the repository at this point in the history
These were highlighted by running the LoadLiveData unit test.
They won't affect the situation that led to the creation of this ticket
as they're MD-related and my test run wasn't.
  • Loading branch information
RussellTaylor committed Jun 14, 2012
1 parent 36a0654 commit d6cbca2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace MDEvents
/// Sample position
Kernel::V3D samplePos;
/// Progress reporter (shared)
Kernel::ProgressBase * prog;
boost::shared_ptr<Kernel::ProgressBase> prog;
/// Matrix. Multiply this by the lab frame Qx, Qy, Qz to get the desired Q or HKL.
Kernel::Matrix<double> mat;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,7 @@ namespace MDEvents
size_t totalEvents = m_inWS->size();
if (m_inEventWS && !OneEventPerBin)
totalEvents = m_inEventWS->getNumberEvents();
prog = new Progress(this, 0, 1.0, totalEvents);
// if (DODEBUG) prog = new ProgressText(0, 1.0, totalCost, true);
// if (DODEBUG) prog->setNotifyStep(1);
prog = boost::make_shared<Progress>(this, 0, 1.0, totalEvents);

// Is the addition of events thread-safe?
bool MultiThreadedAdding = m_inWS->threadSafe();
Expand Down
3 changes: 2 additions & 1 deletion Code/Mantid/Framework/MDEvents/src/MDEventWorkspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace MDEvents
*/
TMDE(
MDEventWorkspace)::MDEventWorkspace()
: m_BoxController(new BoxController(nd))
: m_BoxController(boost::make_shared<BoxController>(nd))
{
// First box is at depth 0, and has this default boxController
data = new MDBox<MDE, nd>(m_BoxController, 0);
Expand Down Expand Up @@ -530,6 +530,7 @@ namespace MDEvents
if (!box) throw
std::runtime_error("MDEventWorkspace::splitBox() expected its data to be a MDBox* to split to MDGridBox.");
gridBox = new MDGridBox<MDE,nd>(box);
delete data;
data = gridBox;
}
}
Expand Down

0 comments on commit d6cbca2

Please sign in to comment.