summaryrefslogtreecommitdiffstats
path: root/examples/gui/rasterwindow/rasterwindow.h
diff options
context:
space:
mode:
authorTang Haixiang <tanghaixiang@uniontech.com>2021-10-21 16:32:59 +0800
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-11-04 03:24:28 +0000
commit203b6519f0df4d132ec812609727a27288294a21 (patch)
tree061dd8d7c644b99496802f62a10ad7c4d1b1e7a4 /examples/gui/rasterwindow/rasterwindow.h
parent2ddf97578c2c6dd45ccbecf3b4afcd345eca04fb (diff)
Use QScopedPointer to manage memory
Although the QBackingStore constructor takes a QWindow* as a parameter, it does not inherit QObject and doesn't become a QObject child of the QWindow. Use QScopedPointer to avoid memory leaks. Change-Id: Ib065163a9149d002f8220a0257bd78549062c595 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit c4856a9075c0a824e7614af621d6785759a3d5f5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/gui/rasterwindow/rasterwindow.h')
-rw-r--r--examples/gui/rasterwindow/rasterwindow.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/gui/rasterwindow/rasterwindow.h b/examples/gui/rasterwindow/rasterwindow.h
index 58c3ab89b2..279952cf61 100644
--- a/examples/gui/rasterwindow/rasterwindow.h
+++ b/examples/gui/rasterwindow/rasterwindow.h
@@ -53,6 +53,7 @@
//! [1]
#include <QtGui>
+#include <QScopedPointer>
class RasterWindow : public QWindow
{
@@ -73,7 +74,7 @@ protected:
void exposeEvent(QExposeEvent *event) override;
private:
- QBackingStore *m_backingStore;
+ QScopedPointer<QBackingStore> m_backingStore;
};
//! [1]
#endif // RASTERWINDOW_H