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

Unified Diff: content/common/gpu/gpu_channel_manager.cc

Issue 299003004: Fix leak in GpuChannel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « content/common/gpu/gpu_channel_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_channel_manager.cc
diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc
index 45298d53911744caed2d8d7acd35de714b887990..7bbfea1de7d38ed0cdf50d55ef01dfd37829edbc 100644
--- a/content/common/gpu/gpu_channel_manager.cc
+++ b/content/common/gpu/gpu_channel_manager.cc
@@ -98,7 +98,7 @@ GpuChannel* GpuChannelManager::LookupChannel(int32 client_id) {
if (iter == gpu_channels_.end())
return NULL;
else
- return iter->second.get();
+ return iter->second;
}
bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) {
@@ -133,14 +133,9 @@ void GpuChannelManager::OnEstablishChannel(int client_id, bool share_context) {
mailbox_manager = mailbox_manager_.get();
}
- scoped_refptr<GpuChannel> channel = new GpuChannel(this,
- watchdog_,
- share_group,
- mailbox_manager,
- client_id,
- false);
+ scoped_ptr<GpuChannel> channel(new GpuChannel(
+ this, watchdog_, share_group, mailbox_manager, client_id, false));
channel->Init(io_message_loop_.get(), shutdown_event_);
- gpu_channels_[client_id] = channel;
channel_handle.name = channel->GetChannelName();
#if defined(OS_POSIX)
@@ -151,6 +146,8 @@ void GpuChannelManager::OnEstablishChannel(int client_id, bool share_context) {
channel_handle.socket = base::FileDescriptor(renderer_fd, true);
#endif
+ gpu_channels_.set(client_id, channel.Pass());
+
Send(new GpuHostMsg_ChannelEstablished(channel_handle));
}
« no previous file with comments | « content/common/gpu/gpu_channel_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698