From d450eb5e6da5a7f2a14bbf02b3c167962e0618fd Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 2 Sep 2014 12:58:53 +0200 Subject: 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 --- .../jar/src/org/qtproject/qt5/android/QtActivityDelegate.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/android') diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index b4b483b416..01aa55c19e 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -1085,11 +1085,14 @@ public class QtActivityDelegate Log.e(QtNative.QtTAG, "Surface " + id +" not found!"); } + if (view == null) + return; + // Keep last frame in stack until it is replaced to get correct // shutdown transition if (m_surfaces.size() == 0 && m_nativeViews.size() == 0) { m_dummyView = view; - } else if (view != null) { + } else { m_layout.removeView(view); } } -- cgit v1.2.3