##// END OF EJS Templates
Fix a major memory leak
Jani Honkonen -
r204:a4ba86638d8d
parent child
Show More
@@ -29,6 +29,7 void ChartDataSet::addSeries(QChartSeries* series)
29 {
29 {
30 // TODO: we should check the series not already added
30 // TODO: we should check the series not already added
31 m_chartSeries << series;
31 m_chartSeries << series;
32 series->setParent(this); // take ownership
32 m_domainIndex = 0;
33 m_domainIndex = 0;
33 m_domains.resize(1);
34 m_domains.resize(1);
34
35
@@ -59,8 +59,7 QPieSeries::QPieSeries(QObject *parent) :
59
59
60 QPieSeries::~QPieSeries()
60 QPieSeries::~QPieSeries()
61 {
61 {
62 // slices destroyed by parent object
62
63 qDebug() << "~QPieSeries";
64 }
63 }
65
64
66 bool QPieSeries::setData(QList<qreal> data)
65 bool QPieSeries::setData(QList<qreal> data)
@@ -11,7 +11,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE
11
11
12 QChartView::QChartView(QWidget *parent) :
12 QChartView::QChartView(QWidget *parent) :
13 QGraphicsView(parent),
13 QGraphicsView(parent),
14 m_scene(new QGraphicsScene()),
14 m_scene(new QGraphicsScene(this)),
15 m_chart(new QChart()),
15 m_chart(new QChart()),
16 m_rubberBand(0),
16 m_rubberBand(0),
17 m_verticalRubberBand(false),
17 m_verticalRubberBand(false),
@@ -24,7 +24,7 public:
24 //implement from QWidget
24 //implement from QWidget
25 void resizeEvent(QResizeEvent *event);
25 void resizeEvent(QResizeEvent *event);
26
26
27 void addSeries(QChartSeries* series);
27 void addSeries(QChartSeries* series); // takes ownership
28
28
29 // Convenience function
29 // Convenience function
30 QChartSeries* createSeries(QChartSeries::QChartSeriesType type);
30 QChartSeries* createSeries(QChartSeries::QChartSeriesType type);
General Comments 0
You need to be logged in to leave comments. Login now