diff options
author | Thiago Macieira <thiago@macieira.org> | 2013-11-30 09:18:02 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-11-30 09:25:11 -0800 |
commit | ba88a3358d2e8ed6b5486fff4c11bbef785ee959 (patch) | |
tree | b550e7dc2354edfe298bf7e8182d167102ae87d2 | |
parent | 58d37e02001d7f54baf35b72dd1323b8886153d9 (diff) | |
download | subsurface-ba88a3358d2e8ed6b5486fff4c11bbef785ee959.tar.gz |
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>
-rw-r--r-- | qt-ui/simplewidgets.cpp | 6 | ||||
-rw-r--r-- | qt-ui/simplewidgets.h | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp index 692cda1a1..006e790bf 100644 --- a/qt-ui/simplewidgets.cpp +++ b/qt-ui/simplewidgets.cpp @@ -61,7 +61,11 @@ double MinMaxAvgWidget::minimum() const } MinMaxAvgWidget::MinMaxAvgWidget(QWidget* parent) -: d(new MinMaxAvgWidgetPrivate(this)){ + : d(new MinMaxAvgWidgetPrivate(this)){ +} + +MinMaxAvgWidget::~MinMaxAvgWidget() +{ } void MinMaxAvgWidget::clear() diff --git a/qt-ui/simplewidgets.h b/qt-ui/simplewidgets.h index 70d61ca59..c924370c5 100644 --- a/qt-ui/simplewidgets.h +++ b/qt-ui/simplewidgets.h @@ -17,6 +17,7 @@ class MinMaxAvgWidget : public QWidget{ Q_PROPERTY(double average READ average WRITE setAverage) public: MinMaxAvgWidget(QWidget *parent); + ~MinMaxAvgWidget(); double minimum() const; double maximum() const; double average() const; @@ -28,7 +29,7 @@ public: void setAverage(const QString& average); void clear(); private: - MinMaxAvgWidgetPrivate *d; + QScopedPointer<MinMaxAvgWidgetPrivate> d; }; class RenumberDialog : public QDialog { |