Index: gpu/command_buffer/service/gles2_cmd_decoder.cc |
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
index 46dc8961d05d4aeb10b72cdd9b1fe1e984276946..4a9c5ef102a738f1fc147c72502cdb0dbeabfdd0 100644 |
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
@@ -4785,6 +4785,10 @@ void GLES2DecoderImpl::Destroy(bool have_context) { |
offscreen_resolved_frame_buffer_.reset(); |
offscreen_resolved_color_texture_.reset(); |
+ // Release all fences now, because some fence types need the context to be |
+ // current on destruction. |
+ pending_readpixel_fences_ = std::queue<FenceCallback>(); |
+ |
// Need to release these before releasing |group_| which may own the |
// ShaderTranslatorCache. |
fragment_translator_ = NULL; |