Commit 2647c809 authored by Marcus D. Hanwell's avatar Marcus D. Hanwell

BUG: Plugged the leak in the chart matrix.

Change-Id: Ib2c0ab6377a092a8e4cf89fffdcd82c344b68f55
parent fcb6670d
......@@ -16,6 +16,7 @@
#include "vtkChartMatrix.h"
#include "vtkChartXY.h"
#include "vtkNew.h"
#include "vtkSmartPointer.h"
#include "vtkContext2D.h"
#include "vtkContextScene.h"
......@@ -120,9 +121,9 @@ vtkChart* vtkChartMatrix::GetChart(const vtkVector2i &position)
size_t index = position.Y() * this->Size.X() + position.X();
if (this->Private->Charts[index] == NULL)
{
vtkChart *chart = vtkChartXY::New();
this->Private->Charts[index] = chart;
this->AddItem(chart);
vtkNew<vtkChartXY> chart;
this->Private->Charts[index] = chart.GetPointer();
this->AddItem(chart.GetPointer());
chart->SetAutoSize(false);
}
return this->Private->Charts[index];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment