diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index c75090f0c28..6700bc28a96 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -433,13 +433,6 @@ QCocoaWindow::~QCocoaWindow() if (window()->type() != Qt::ForeignWindow) [[NSNotificationCenter defaultCenter] removeObserver:m_view]; - // The QNSView object may outlive the corresponding QCocoaWindow object, - // for example during app shutdown when the QNSView is embedded in a - // foregin NSView hiearchy. Clear the pointers to the QWindow/QCocoaWindow - // here to make sure QNSView does not dereference stale pointers. - if (window()->type() != Qt::ForeignWindow) - [qnsview_cast(m_view) clearQWindowPointers]; - // While it is unlikely that this window will be in the popup stack // during deletetion we clear any pointers here to make sure. if (QCocoaIntegration::instance()) { diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index 963b29ebbb4..57b159bbf51 100644 --- a/src/plugins/platforms/cocoa/qnsview.h +++ b/src/plugins/platforms/cocoa/qnsview.h @@ -65,7 +65,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper)); uchar *m_maskData; bool m_shouldInvalidateWindowShadow; QPointer m_window; - QCocoaWindow *m_platformWindow; + QPointer m_platformWindow; NSTrackingArea *m_trackingArea; Qt::MouseButtons m_buttons; Qt::MouseButtons m_acceptedMouseDowns; @@ -92,7 +92,6 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper)); - (id)init; - (id)initWithQWindow:(QWindow *)window platformWindow:(QCocoaWindow *) platformWindow; -- (void) clearQWindowPointers; #ifndef QT_NO_OPENGL - (void)setQCocoaGLContext:(QCocoaGLContext *)context; #endif diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index be2342d51ec..1f92dc82d66 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -229,12 +229,6 @@ static bool _q_dontOverrideCtrlLMB = false; return self; } -- (void) clearQWindowPointers -{ - m_window = 0; - m_platformWindow = 0; -} - #ifndef QT_NO_OPENGL - (void) setQCocoaGLContext:(QCocoaGLContext *)context {