From 1b75a04336452bd4b5fc3764f26157d14c4e53a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 16 Dec 2016 10:27:58 +0100 Subject: Fix spelling: neccessary -> necessary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7c1b1d4ef12391e1caf00eae4b816cdc6d08ee04 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm | 2 +- src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm | 2 +- src/plugins/platforms/cocoa/qcocoaintegration.mm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm index 7368aabf7d..35ac7182af 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm @@ -286,7 +286,7 @@ QT_END_NAMESPACE if (qEnvironmentVariableIsEmpty("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM")) { if (QSysInfo::macVersion() >= QSysInfo::MV_10_12) { // Move the application window to front to avoid launching behind the terminal. - // Ignoring other apps is neccessary (we must ignore the terminal), but makes + // Ignoring other apps is necessary (we must ignore the terminal), but makes // Qt apps play slightly less nice with other apps when lanching from Finder // (See the activateIgnoringOtherApps docs.) [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm index 234da57f59..2aaad38659 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm @@ -428,7 +428,7 @@ static QString strippedText(QString s) { // Call this functions if mFileMode, mFileOptions, // mNameFilterDropDownList or mQDirFilter changes. - // The savepanel does not contain the neccessary functions for this. + // The savepanel does not contain the necessary functions for this. const QFileDialogOptions::FileMode fileMode = mOptions->fileMode(); bool chooseFilesOnly = fileMode == QFileDialogOptions::ExistingFile || fileMode == QFileDialogOptions::ExistingFiles; diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index 18340f4ee1..fe4933ed6f 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -316,7 +316,7 @@ QCocoaIntegration::QCocoaIntegration(const QStringList ¶mList) // from the terminal. On 10.12+ this call has been moved to applicationDidFinishLauching // to work around issues with loss of focus at startup. if (QSysInfo::macVersion() < QSysInfo::MV_10_12) { - // Ignoring other apps is neccessary (we must ignore the terminal), but makes + // Ignoring other apps is necessary (we must ignore the terminal), but makes // Qt apps play slightly less nice with other apps when lanching from Finder // (See the activateIgnoringOtherApps docs.) [cocoaApplication activateIgnoringOtherApps : YES]; -- cgit v1.2.3 From da4b91e2b2c6bb7949e2151a72be1f11c28768d6 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Wed, 1 Mar 2017 17:39:25 +0200 Subject: Fix hang on sleep/wakeup This patch fixes the followings: - call "it.value()" only on valid iterators - destroySurface() doesn't remove the surfaceId from m_surfaces - the surfaceId is removed from m_surfaces when the QtSurface is really destroyed Task-number: QTBUG-59185 Change-Id: Iee37dde16fee16f19906812c55c1f0b0279b033c Reviewed-by: Mathias Hasselmann Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/plugins/platforms/android/androidjnimain.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp index 1f681cc1a3..0fabb25233 100644 --- a/src/plugins/platforms/android/androidjnimain.cpp +++ b/src/plugins/platforms/android/androidjnimain.cpp @@ -402,11 +402,6 @@ namespace QtAndroid if (surfaceId == -1) return; - QMutexLocker lock(&m_surfacesMutex); - const auto &it = m_surfaces.find(surfaceId); - if (it != m_surfaces.end()) - m_surfaces.remove(surfaceId); - QJNIEnvironmentPrivate env; if (!env) return; @@ -583,14 +578,18 @@ static void setSurface(JNIEnv *env, jobject /*thiz*/, jint id, jobject jSurface, { QMutexLocker lock(&m_surfacesMutex); const auto &it = m_surfaces.find(id); - if (it.value() == nullptr) // This should never happen... - return; - if (it == m_surfaces.end()) { qWarning()<<"Can't find surface" << id; return; } - it.value()->surfaceChanged(env, jSurface, w, h); + auto surfaceClient = it.value(); + if (!surfaceClient) // This should never happen... + return; + + surfaceClient->surfaceChanged(env, jSurface, w, h); + + if (!jSurface) + m_surfaces.erase(it); } static void setDisplayMetrics(JNIEnv */*env*/, jclass /*clazz*/, -- cgit v1.2.3