Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 8205021: Ensure that a ContextGroup is not destroyed if it was not correctly initialized. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
===================================================================
--- gpu/command_buffer/service/gles2_cmd_decoder.cc (revision 104543)
+++ gpu/command_buffer/service/gles2_cmd_decoder.cc (working copy)
@@ -1765,6 +1765,7 @@
if (!MakeCurrent()) {
LOG(ERROR) << "GLES2DecoderImpl::Initialize failed because "
<< "MakeCurrent failed.";
+ group_ = NULL; // Must not destroy ContextGroup if it is not initialized.
Destroy();
return false;
}
@@ -1772,6 +1773,7 @@
if (!group_->Initialize(disallowed_features, allowed_extensions)) {
LOG(ERROR) << "GpuScheduler::InitializeCommon failed because group "
<< "failed to initialize.";
+ group_ = NULL; // Must not destroy ContextGroup if it is not initialized.
Destroy();
return false;
}
@@ -2414,8 +2416,10 @@
offscreen_resolved_color_texture_->Invalidate();
}
- group_->Destroy(have_context);
- group_ = NULL;
+ if (group_) {
+ group_->Destroy(have_context);
+ group_ = NULL;
+ }
if (context_.get()) {
context_->ReleaseCurrent(NULL);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698