Fix memory leak of the MinMaxAvgWidgetPrivate

Found by Dr. Memory, run by Lubomir:
Error #63: LEAK 24 direct bytes 0x344f42e8-0x344f4300 + 0 indirect bytes
 # 0 replace_operator_new                             [d:\drmemory_package\common\alloc_replace.c:2421]
 # 1 MinMaxAvgWidget::MinMaxAvgWidget()               [qt-ui/simplewidgets.cpp:64]

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Thiago Macieira 2013-11-30 09:18:02 -08:00 committed by Dirk Hohndel
parent 58d37e0200
commit ba88a3358d
2 changed files with 7 additions and 2 deletions

View file

@ -61,7 +61,11 @@ double MinMaxAvgWidget::minimum() const
} }
MinMaxAvgWidget::MinMaxAvgWidget(QWidget* parent) MinMaxAvgWidget::MinMaxAvgWidget(QWidget* parent)
: d(new MinMaxAvgWidgetPrivate(this)){ : d(new MinMaxAvgWidgetPrivate(this)){
}
MinMaxAvgWidget::~MinMaxAvgWidget()
{
} }
void MinMaxAvgWidget::clear() void MinMaxAvgWidget::clear()

View file

@ -17,6 +17,7 @@ class MinMaxAvgWidget : public QWidget{
Q_PROPERTY(double average READ average WRITE setAverage) Q_PROPERTY(double average READ average WRITE setAverage)
public: public:
MinMaxAvgWidget(QWidget *parent); MinMaxAvgWidget(QWidget *parent);
~MinMaxAvgWidget();
double minimum() const; double minimum() const;
double maximum() const; double maximum() const;
double average() const; double average() const;
@ -28,7 +29,7 @@ public:
void setAverage(const QString& average); void setAverage(const QString& average);
void clear(); void clear();
private: private:
MinMaxAvgWidgetPrivate *d; QScopedPointer<MinMaxAvgWidgetPrivate> d;
}; };
class RenumberDialog : public QDialog { class RenumberDialog : public QDialog {