Page MenuHomePhabricator

MitkChart: Memory management of QmitkChartxyData
Closed, ResolvedPublic

Description

in QmitkChartWidget:

150 new QmitkChartxyData(data1DConverted, ...)
176 new QmitkChartxyData(data2DConverted, ...)

However, the pointer is never deleted again. Make sure it is.

Revisions and Commits

rMITK MITK

Event Timeline

hentsch changed the visibility from "Custom Policy" to "Public (No Login Required)".
hentsch changed the edit policy from "Custom Policy" to "All Users".
hentsch added a subscriber: kleina.

There's a problem with the Ubuntu build:

c++: error: CMakeFiles/MitkChart.dir/src/QmitkChartWidget.cpp.o: Datei oder Verzeichnis nicht gefunden

Modules/Chart/src/QmitkChartWidget.cpp
In file included from /opt/Qt5.6.0/5.6/gcc_64/include/QtCore/qlist.h:37:0,
                 from /opt/Qt5.6.0/5.6/gcc_64/include/QtCore/qobject.h:43,
                 from /opt/Qt5.6.0/5.6/gcc_64/include/QtWidgets/qwidget.h:38,
                 from /opt/Qt5.6.0/5.6/gcc_64/include/QtWidgets/QWidget:1,
                 from /home/mbivm10/docubuild/MITK/Modules/Chart/include/QmitkChartWidget.h:20,
                 from /home/mbivm10/docubuild/MITK/Modules/Chart/src/QmitkChartWidget.cpp:17:
/opt/Qt5.6.0/5.6/gcc_64/include/QtCore/qalgorithms.h: In instantiation of ‘void qDeleteAll(const Container&) [with Container = std::vector<QmitkChartxyData*>*]’:
/home/mbivm10/docubuild/MITK/Modules/Chart/src/QmitkChartWidget.cpp:132:24:   required from here
/opt/Qt5.6.0/5.6/gcc_64/include/QtCore/qalgorithms.h:325:15: error: request for member ‘begin’ in ‘c’, which is of pointer type ‘std::vector<QmitkChartxyData*>* const’ (maybe you meant to use ‘->’ ?)
     qDeleteAll(c.begin(), c.end());
               ^
/opt/Qt5.6.0/5.6/gcc_64/include/QtCore/qalgorithms.h:325:15: error: request for member ‘end’ in ‘c’, which is of pointer type ‘std::vector<QmitkChartxyData*>* const’ (maybe you meant to use ‘->’ ?)

I included this in my "clang" branch since I thought it was a local problem. You can cherry pick the fix, don't know when I can merge