summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-10 21:46:42 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-10 21:46:42 +0000
commit1871a0953a61c77e7d0f6e127c2c6aeb082c0394 (patch)
tree8e04bf9b7c2a7c16aa12124be2e498d5b0c403c1 /gpu/command_buffer
parent591d9342eb97309402379826ab5738d78414d323 (diff)
downloadchromium_src-1871a0953a61c77e7d0f6e127c2c6aeb082c0394.zip
chromium_src-1871a0953a61c77e7d0f6e127c2c6aeb082c0394.tar.gz
chromium_src-1871a0953a61c77e7d0f6e127c2c6aeb082c0394.tar.bz2
Ensure that a ContextGroup is not destroyed if it was not correctly initialized.
The counting of contexts in the group was out of sync, causing an assertion in release builds. BUG=97775 Review URL: http://codereview.chromium.org/8205021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104791 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index c3402d9..0dab855 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1765,6 +1765,7 @@ bool GLES2DecoderImpl::Initialize(
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 @@ bool GLES2DecoderImpl::Initialize(
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 @@ void GLES2DecoderImpl::Destroy() {
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);