diff options
author | Paul Olav Tvete <paul.tvete@digia.com> | 2014-09-02 12:58:53 +0200 |
---|---|---|
committer | BogDan Vatra <bogdan@kde.org> | 2014-09-02 22:00:02 +0200 |
commit | d450eb5e6da5a7f2a14bbf02b3c167962e0618fd (patch) | |
tree | 111ea344ed64416839496a3040eff61d2c1c78da /src/plugins | |
parent | a8b243b42e95094b4b464eed884b641cc1cbdbf4 (diff) |
Android: Guard against invalid surfaceID
Do not try to resize or destroy invalid surfaces.
This caused update problems with all GL apps after suspend,
since we would forget the dummy view that we always keep
around so we get proper transitions on shutdown.
Also make sure that we don't mess this up even if we try to destroy a
non-existing surface. This would have fixed the bug by itself, but
then we would still be stuck with the annoying warning message.
Task-number: QTBUG-41093
Change-Id: I83299e93eb9ac5357b98ca47014789b56c91b35a
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/android/androidjnimain.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp index de30fa825a..7b76177141 100644 --- a/src/plugins/platforms/android/androidjnimain.cpp +++ b/src/plugins/platforms/android/androidjnimain.cpp @@ -380,6 +380,9 @@ namespace QtAndroid void setSurfaceGeometry(int surfaceId, const QRect &geometry) { + if (surfaceId == -1) + return; + QJNIEnvironmentPrivate env; if (!env) return; @@ -399,6 +402,9 @@ namespace QtAndroid void destroySurface(int surfaceId) { + if (surfaceId == -1) + return; + QMutexLocker lock(&m_surfacesMutex); const auto &it = m_surfaces.find(surfaceId); if (it != m_surfaces.end()) |