Ensure the destructor is called since it destroys the EGLSurface before creating a new onscreen surface. (flutter/engine#20916)

This commit is contained in:
Guokai-Cheng
2020-09-04 05:32:48 +08:00
committed by GitHub
parent 44bd4cf1d7
commit 03d8863078

View File

@@ -92,6 +92,9 @@ bool AndroidSurfaceGL::SetNativeWindow(
FML_DCHECK(IsValid());
FML_DCHECK(window);
native_window_ = window;
// Ensure the destructor is called since it destroys the `EGLSurface` before
// creating a new onscreen surface.
onscreen_surface_ = nullptr;
// Create the onscreen surface.
onscreen_surface_ = android_context_->CreateOnscreenSurface(window);
if (!onscreen_surface_->IsValid()) {