Skip to content

Commit 1ddc6e1

Browse files
author
Emmanuel Garcia
authored
Call destructor and fix check (flutter#18985)
1 parent e5845af commit 1ddc6e1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

shell/platform/android/android_surface_gl.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,11 @@ bool AndroidSurfaceGL::OnScreenSurfaceResize(const SkISize& size) {
5757

5858
android_context_->ClearCurrent();
5959

60+
// Ensure the destructor is called since it destroys the `EGLSurface` before
61+
// creating a new onscreen surface.
62+
onscreen_surface_ = nullptr;
6063
onscreen_surface_ = android_context_->CreateOnscreenSurface(native_window_);
61-
if (onscreen_surface_->IsValid()) {
64+
if (!onscreen_surface_->IsValid()) {
6265
FML_LOG(ERROR) << "Unable to create EGL window surface on resize.";
6366
return false;
6467
}

0 commit comments

Comments
 (0)