diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-26 16:22:39 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-26 16:22:39 +0000 |
commit | 1350e835544422e5c3e56e20d38c914edacd607c (patch) | |
tree | bdff1bea36c72046349d7eecb0944d49aeb12b90 /net | |
parent | aaffc2bb14431730dc576a52857ad69b1d8a8eed (diff) | |
download | chromium_src-1350e835544422e5c3e56e20d38c914edacd607c.zip chromium_src-1350e835544422e5c3e56e20d38c914edacd607c.tar.gz chromium_src-1350e835544422e5c3e56e20d38c914edacd607c.tar.bz2 |
ClientSocketPoolBaseHelper crash fix: add a self-reference.
BUG=49254
Review URL: http://codereview.chromium.org/3127035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57529 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/socket/client_socket_pool_base.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/socket/client_socket_pool_base.cc b/net/socket/client_socket_pool_base.cc index 70358d1..631ef5e 100644 --- a/net/socket/client_socket_pool_base.cc +++ b/net/socket/client_socket_pool_base.cc @@ -583,6 +583,12 @@ void ClientSocketPoolBaseHelper::OnConnectJobComplete( BoundNetLog job_log = job->net_log(); + // ConnectJobs may hold references to pools which may hold references back to + // this pool, so RemoveConnectJob() may eventually lead to something calling + // Release() on |this| which deletes it in the middle of this function. Hold + // a self-reference to prevent deletion of |this|. + const scoped_refptr<ClientSocketPoolBaseHelper> self(this); + if (result == OK) { DCHECK(socket.get()); RemoveConnectJob(job, group); |