Skip to content
Snippets Groups Projects
Commit bfcb08b8 authored by Nick Draper's avatar Nick Draper
Browse files

re #13928 move code to aviod possible memory leak

parent c481d6e5
No related branches found
No related tags found
No related merge requests found
......@@ -92,6 +92,12 @@ namespace Mantid
coord_t incrementX = (maxX - minX) / static_cast<coord_t>(nBinsX);
coord_t incrementY = (maxY - minY) / static_cast<coord_t>(nBinsY);
boost::scoped_ptr<MDHistoWorkspaceIterator> iterator(dynamic_cast<MDHistoWorkspaceIterator*>(createIteratorWithNormalization(m_normalizationOption, m_workspace.get())));
if (!iterator) {
throw std::runtime_error(
"Could not convert IMDIterator to a MDHistoWorkspaceIterator");
}
const int imageSize = (nBinsX ) * (nBinsY );
vtkPoints *points = vtkPoints::New();
points->Allocate(static_cast<int>(imageSize));
......@@ -119,11 +125,6 @@ namespace Mantid
double progressFactor = 0.5/double(nBinsX);
double progressOffset = 0.5;
boost::scoped_ptr<MDHistoWorkspaceIterator> iterator(dynamic_cast<MDHistoWorkspaceIterator*>(createIteratorWithNormalization(m_normalizationOption, m_workspace.get())));
if (!iterator) {
throw std::runtime_error(
"Could not convert IMDIterator to a MDHistoWorkspaceIterator");
}
size_t index = 0;
for (int i = 0; i < nBinsX; i++)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment