Chris Bracken a712590dfc Only call destruction_callback if non-null (flutter/engine#24845)
In MakeSkSurfaceFromBackingStore and other places in embedder.cc, we
call a texture or framebuffer destruction callback without first
verifying it's non-null. This adds a check before such calls.

Currently fl_renderer_gl_create_backing_store() in the Linux GTK
embedder and ExternalTextureGL::PopulateTexture() in the Windows
embedder either explicitly or implicitly set a null destruction
callback.

This prevents a crash reported when running under OpenGL ES 2.0 reported
in https://github.com/flutter/flutter/issues/76881.

While this prevents the crash, it does not fix the underlying issue.
2021-03-08 17:31:22 -08:00
..