Commit f4c20b08 authored by liberato@chromium.org's avatar liberato@chromium.org Committed by Commit Bot

Make ~SurfaceTextureGLOwner check for null Surface.

During GPU process teardown, the GpuCommandBufferStub clears the
current surface.  ScopedMakeCurrent doesn't handle this case well.

Since the process is going away, we just skip GL cleanup.

Bug: 718117
Change-Id: I04dce5d60fbe9d3f6c060c161029d7ec724ecdb0
Reviewed-on: https://chromium-review.googlesource.com/544381Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Reviewed-by: default avatarChris Watkins <watk@chromium.org>
Commit-Queue: Frank Liberato <liberato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#481739}
parent 18ec3b79
...@@ -70,6 +70,12 @@ SurfaceTextureGLOwnerImpl::~SurfaceTextureGLOwnerImpl() { ...@@ -70,6 +70,12 @@ SurfaceTextureGLOwnerImpl::~SurfaceTextureGLOwnerImpl() {
// Make sure that the SurfaceTexture isn't using the GL objects. // Make sure that the SurfaceTexture isn't using the GL objects.
surface_texture_ = nullptr; surface_texture_ = nullptr;
if (gl::GLSurface::GetCurrent() == nullptr) {
// This happens during GpuCommandBufferStub teardown. Just leave -- the gpu
// process is going away. crbug.com/718117 .
return;
}
ui::ScopedMakeCurrent scoped_make_current(context_.get(), surface_.get()); ui::ScopedMakeCurrent scoped_make_current(context_.get(), surface_.get());
if (scoped_make_current.Succeeded()) { if (scoped_make_current.Succeeded()) {
glDeleteTextures(1, &texture_id_); glDeleteTextures(1, &texture_id_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment