0

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
This commit is contained in:
apatrick@chromium.org
2011-10-10 21:46:42 +00:00
parent 591d9342eb
commit 1871a0953a

@ -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);