From c4856a9075c0a824e7614af621d6785759a3d5f5 Mon Sep 17 00:00:00 2001 From: Tang Haixiang Date: Thu, 21 Oct 2021 16:32:59 +0800 Subject: 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. Pick-to: 6.2 Change-Id: Ib065163a9149d002f8220a0257bd78549062c595 Reviewed-by: Volker Hilsheimer Reviewed-by: Paul Wicking --- examples/gui/rasterwindow/rasterwindow.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples/gui/rasterwindow') 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 +#include class RasterWindow : public QWindow { @@ -73,7 +74,7 @@ protected: void exposeEvent(QExposeEvent *event) override; private: - QBackingStore *m_backingStore; + QScopedPointer m_backingStore; }; //! [1] #endif // RASTERWINDOW_H -- cgit v1.2.3