summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qnsview.h
diff options
context:
space:
mode:
authorTim Blechmann <tim@klingt.org>2014-11-01 14:37:52 +0100
committerJørgen Lind <jorgen.lind@theqtcompany.com>2015-06-24 07:25:28 +0000
commit32ce3b0eaf8568d62e6f197408a80f023f005f1d (patch)
tree29c731c41e93a6847e5330ac54ada2c6fe3e23d6 /src/plugins/platforms/cocoa/qnsview.h
parentbac1116d4997fa0c7c58538b39528ecc354d88d1 (diff)
cocoa: QNSView - guard implementation against deleted window
when embedding a QWindow into a native cocoa gui there are cases that the QWindow is destroyed while the QNSView is still available. this patch makes sure that the m_window pointer is cleared when the QWindow is destroyed and adds checks to the implementation to avoid that m_window is called when it has already been destroyed. Change-Id: I7e0614969dedb87b54df74d542a8c1fb15d8acf0 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview.h')
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h
index 32bc15d092..05ab8ae2c7 100644
--- a/src/plugins/platforms/cocoa/qnsview.h
+++ b/src/plugins/platforms/cocoa/qnsview.h
@@ -57,7 +57,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper));
CGImageRef m_maskImage;
uchar *m_maskData;
bool m_shouldInvalidateWindowShadow;
- QWindow *m_window;
+ QPointer<QWindow> m_window;
QCocoaWindow *m_platformWindow;
NSTrackingArea *m_trackingArea;
Qt::MouseButtons m_buttons;