You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
EGLImpl: fix crash when eglDestroySurface is passed EGL_NO_SURFACE
This commit is contained in:
@@ -114,9 +114,11 @@ JNIEXPORT jboolean JNICALL Java_com_google_android_gles_1jni_EGLImpl_native_1egl
|
|||||||
{
|
{
|
||||||
struct ANativeWindow *native_window = g_hash_table_lookup(egl_surface_hashtable, _PTR(surface));
|
struct ANativeWindow *native_window = g_hash_table_lookup(egl_surface_hashtable, _PTR(surface));
|
||||||
|
|
||||||
bool ret = eglDestroySurface(_PTR(display), _PTR(surface));
|
EGLBoolean ret = eglDestroySurface(_PTR(display), _PTR(surface));
|
||||||
|
if (ret) {
|
||||||
/* ANativeWindow_fromSurface starts the refcounter at 1, so this will destroy the native window */
|
/* ANativeWindow_fromSurface starts the refcounter at 1, so this will destroy the native window */
|
||||||
ANativeWindow_release(native_window);
|
ANativeWindow_release(native_window);
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user