diff options
author | tschmelcher@chromium.org <tschmelcher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-15 21:49:12 +0000 |
---|---|---|
committer | tschmelcher@chromium.org <tschmelcher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-15 21:49:12 +0000 |
commit | 8cb1442cc3b16a67c515bb3d1076d7eba4749b98 (patch) | |
tree | 5c154dfb41856251176604bb80504d3ad40893f7 /o3d | |
parent | eeb015c6590d96df736b5d105b54d17a6da0aaed (diff) | |
download | chromium_src-8cb1442cc3b16a67c515bb3d1076d7eba4749b98.zip chromium_src-8cb1442cc3b16a67c515bb3d1076d7eba4749b98.tar.gz chromium_src-8cb1442cc3b16a67c515bb3d1076d7eba4749b98.tar.bz2 |
Fix issue in Safari 5 on Mac OS X 10.6 on Mac Minis where drawInCGLContext/copyCGLContextForPixelFormat are called a second time during shutdown in certain hosting pages, causing an assert due to duplicate creation of the Renderer service.
TEST=repeatedly launched/exiting the affected O3D app and verified no crash or other issue
BUG=none
Review URL: http://codereview.chromium.org/2740011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49835 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r-- | o3d/plugin/mac/o3d_layer.mm | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/o3d/plugin/mac/o3d_layer.mm b/o3d/plugin/mac/o3d_layer.mm index 194cc5e..a566f1b6 100644 --- a/o3d/plugin/mac/o3d_layer.mm +++ b/o3d/plugin/mac/o3d_layer.mm @@ -115,14 +115,16 @@ using o3d::DisplayWindowMac; * renderers from pixel format 'pixelFormat'. The default implementation * allocates a new context with a null share context. */ - (CGLContextObj)copyCGLContextForPixelFormat:(CGLPixelFormatObj)pixelFormat { - CGLContextObj share_context = obj_->GetFullscreenShareContext(); - DCHECK(share_context); - if (CGLCreateContext(pixelFormat, share_context, &glContext_) != - kCGLNoError) { - glContext_ = [super copyCGLContextForPixelFormat:pixelFormat]; + if (glContext_ == NULL) { + CGLContextObj share_context = obj_->GetFullscreenShareContext(); + DCHECK(share_context); + if (CGLCreateContext(pixelFormat, share_context, &glContext_) != + kCGLNoError) { + glContext_ = [super copyCGLContextForPixelFormat:pixelFormat]; + } + obj_->SetMacCGLContext(glContext_); + created_context_ = true; } - obj_->SetMacCGLContext(glContext_); - created_context_ = true; return glContext_; } |