Fix tst_QDialog::deleteInExec() crash on Mac OS X
When destroying a window immediately after showing it, we can sometimes provoke a crash in Cocoa after the show-window-animation has finished (which appears to assume that the window's view will always be valid). Prevent the crash by not removing the view from the window. When recreating a window, we explicitly release the old window, but we do not release the view, so we can freely add it to the new window (i.e. this does not introduce new bugs related to recreating the platform window). Task-number: QTBUG-24977 Change-Id: I466ce75b04785401032a0a2d4a2c494910cd1672 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
This commit is contained in:
parent
a2e42a6a0a
commit
5a57ddebf5
@ -479,7 +479,6 @@ void QCocoaWindow::clearNSWindow(NSWindow *window)
|
||||
{
|
||||
[window setDelegate:nil];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:m_contentView];
|
||||
[m_contentView removeFromSuperviewWithoutNeedingDisplay];
|
||||
}
|
||||
|
||||
// Returns the current global screen geometry for the nswindow associated with this window.
|
||||
|
@ -2,4 +2,3 @@ CONFIG += testcase
|
||||
TARGET = tst_qdialog
|
||||
QT += widgets testlib
|
||||
SOURCES += tst_qdialog.cpp
|
||||
mac:CONFIG += insignificant_test # QTBUG-24977
|
||||
|
Loading…
Reference in New Issue
Block a user