diff options
author | dongseong.hwang@intel.com <dongseong.hwang@intel.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-10 13:02:39 +0000 |
---|---|---|
committer | dongseong.hwang@intel.com <dongseong.hwang@intel.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-10 13:02:39 +0000 |
commit | 0f1abdc7a79ef315d1c40c82a025420751c1412f (patch) | |
tree | b20c3416e7e0fc1a961518cb23ad8544d51fb2b7 /webkit/common | |
parent | 5835f2d525edfb9bc73a87de2fec3afccf186f72 (diff) | |
download | chromium_src-0f1abdc7a79ef315d1c40c82a025420751c1412f.zip chromium_src-0f1abdc7a79ef315d1c40c82a025420751c1412f.tar.gz chromium_src-0f1abdc7a79ef315d1c40c82a025420751c1412f.tar.bz2 |
Fix memory leak in WebGraphicsContext3DInProcessCommandBufferImpl.
Currently this class dose not release member context_. This patch manages
context_ using smart pointer.
BUG=258007
Review URL: https://chromiumcodereview.appspot.com/18299004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210822 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/common')
-rw-r--r-- | webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc | 5 | ||||
-rw-r--r-- | webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc index c193946..de3efd2 100644 --- a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc +++ b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc @@ -96,7 +96,6 @@ WebGraphicsContext3DInProcessCommandBufferImpl:: window_(window), initialized_(false), initialize_failed_(false), - context_(NULL), gl_(NULL), context_lost_callback_(NULL), context_lost_reason_(GL_NO_ERROR), @@ -149,7 +148,7 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::MaybeInitializeGL() { base::Bind(&WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost, base::Unretained(this)); - context_ = GLInProcessContext::CreateContext( + context_.reset(GLInProcessContext::CreateContext( is_offscreen_, window_, gfx::Size(1, 1), @@ -157,7 +156,7 @@ bool WebGraphicsContext3DInProcessCommandBufferImpl::MaybeInitializeGL() { preferred_extensions, attribs, gpu_preference, - context_lost_callback); + context_lost_callback)); if (!context_) { initialize_failed_ = true; diff --git a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h index bb4f3da..9f65bf3 100644 --- a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h +++ b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h @@ -563,7 +563,7 @@ class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl bool initialize_failed_; // The context we use for OpenGL rendering. - ::gpu::GLInProcessContext* context_; + scoped_ptr< ::gpu::GLInProcessContext> context_; // The GLES2Implementation we use for OpenGL rendering. ::gpu::gles2::GLES2Implementation* gl_; |