From a66d0f17c040af2f95df9f60898e15f38cc6b6f4 2012-02-20 14:45:28 From: Jani Honkonen Date: 2012-02-20 14:45:28 Subject: [PATCH] Fix a major memory leak --- diff --git a/src/chartdataset.cpp b/src/chartdataset.cpp index 772a113..c8142c1 100644 --- a/src/chartdataset.cpp +++ b/src/chartdataset.cpp @@ -38,6 +38,7 @@ void ChartDataSet::addSeries(QChartSeries* series, QChartAxis *axisY) // TODO: we should check the series not already added series->setParent(this); // take ownership + series->setParent(this); // take ownership clearDomains(); if(axisY==0) axisY = m_axisY; diff --git a/src/qchartview.h b/src/qchartview.h index 9541ccc..b7acb5b 100644 --- a/src/qchartview.h +++ b/src/qchartview.h @@ -24,9 +24,8 @@ public: //implement from QWidget void resizeEvent(QResizeEvent *event); - void addSeries(QChartSeries* series,QChartAxis* axisY=0) ;// takes ownership + void addSeries(QChartSeries* series,QChartAxis* axisY=0);// takes ownership void removeSeries(QChartSeries* series); - int margin() const; void setChartTitle(const QString& title);