diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp index 3e3e169df9..e7e0375adf 100644 --- a/src/plugins/platforms/android/androidjnimain.cpp +++ b/src/plugins/platforms/android/androidjnimain.cpp @@ -413,10 +413,9 @@ namespace QtAndroid { QMutexLocker lock(&m_surfacesMutex); const auto &it = m_surfaces.find(surfaceId); - if (it == m_surfaces.end()) - return; + if (it != m_surfaces.end()) + m_surfaces.remove(surfaceId); - m_surfaces.remove(surfaceId); QJNIEnvironmentPrivate env; if (!env) return;