summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-03-27 08:43:19 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2017-03-27 09:21:47 +0000
commitd5df0e99490098a8ed5ccdb29a82f796d41044e3 (patch)
treec540bf33502b2aa4f0c0ae8a28a8fc22a4a78ac6 /src/plugins/platforms
parent1e7795ef604fe22895b8ec5c2278fea4217f2c07 (diff)
parent7702fe86029c771e641a918baa221b9737c0f18e (diff)
Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp17
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm2
4 files changed, 11 insertions, 12 deletions
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*/,
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 41a809cdd2..e39d5e4546 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -429,7 +429,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 91f408e5c2..9dfcb82151 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -340,7 +340,7 @@ QCocoaIntegration::QCocoaIntegration(const QStringList &paramList)
// 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];