QScopedPointer<QPlatformAccessibility> mAccessibility;
QScopedPointer<QPlatformTheme> mPlatformTheme;
+ QList<QCocoaScreen *> mScreens;
};
QT_END_NAMESPACE
NSArray *screens = [NSScreen screens];
for (uint i = 0; i < [screens count]; i++) {
QCocoaScreen *screen = new QCocoaScreen(i);
+ mScreens.append(screen);
screenAdded(screen);
}
QCocoaIntegration::~QCocoaIntegration()
{
[[NSApplication sharedApplication] setDelegate: 0];
+
+ // Delete screens in reverse order to avoid crash in case of multiple screens
+ while (!mScreens.isEmpty()) {
+ delete mScreens.takeLast();
+ }
}
bool QCocoaIntegration::hasCapability(QPlatformIntegration::Capability cap) const
QWindowsScreenManager();
- inline void clearScreens() { qDeleteAll(m_screens); m_screens.clear(); }
+ inline void clearScreens() {
+ // Delete screens in reverse order to avoid crash in case of multiple screens
+ while (!m_screens.isEmpty())
+ delete m_screens.takeLast();
+ }
void handleScreenChanges();
bool handleDisplayChange(WPARAM wParam, LPARAM lParam);
{
delete m_clipboard;
- qDeleteAll(m_screens);
+ // Delete screens in reverse order to avoid crash in case of multiple screens
+ while (!m_screens.isEmpty())
+ delete m_screens.takeLast();
#ifdef XCB_USE_XINPUT2_MAEMO
finalizeXInput2();
void tst_QApplication::quitOnLastWindowClosed()
{
-#ifdef Q_OS_WIN32
- QSKIP("This test crashes on Windows. Remove skip once the issue causing the crash is fixed (QTBUG-24300).");
-#endif
#ifndef Q_OS_MAC
// Test hangs on Mac OS X, see QTBUG-24319
{