Android: Check for null pointer before calling ANativeWindow_release()

Calling ANativeWindow_release() with a null pointer will cause
a SIGSEGV.

Task-number: QTBUG-33955
Change-Id: If7d1afa3baea04360507eec5042b4e18a0272527
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
This commit is contained in:
Christian Strømme 2013-10-21 17:58:43 +02:00 committed by The Qt Project
parent 159f086a7f
commit efc61299bd

View File

@ -120,7 +120,8 @@ EGLNativeWindowType QEglFSAndroidHooks::createNativeWindow(QPlatformWindow *plat
void QEglFSAndroidHooks::destroyNativeWindow(EGLNativeWindowType window)
{
ANativeWindow_release(window);
if (window != 0)
ANativeWindow_release(window);
}
bool QEglFSAndroidHooks::hasCapability(QPlatformIntegration::Capability capability) const