diff options
author | szym@chromium.org <szym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-26 12:21:45 +0000 |
---|---|---|
committer | szym@chromium.org <szym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-26 12:21:45 +0000 |
commit | 98473afaf5070180e784f1cd50d6a2fd0f8f80b4 (patch) | |
tree | 8cbb74be9ca4340d38e6a4b6b746b8a37d72fb1b /net/udp | |
parent | 2cdf117b32136eae2b71ca10e1e23a39da17f119 (diff) | |
download | chromium_src-98473afaf5070180e784f1cd50d6a2fd0f8f80b4.zip chromium_src-98473afaf5070180e784f1cd50d6a2fd0f8f80b4.tar.gz chromium_src-98473afaf5070180e784f1cd50d6a2fd0f8f80b4.tar.bz2 |
[net/udp] Close events and invalidate handles when UDPSocketWin is closed
BUG=121085
Review URL: https://chromiumcodereview.appspot.com/10882020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153417 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/udp')
-rw-r--r-- | net/udp/udp_socket_win.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/udp/udp_socket_win.cc b/net/udp/udp_socket_win.cc index 03c724e..f67c010 100644 --- a/net/udp/udp_socket_win.cc +++ b/net/udp/udp_socket_win.cc @@ -83,6 +83,11 @@ void UDPSocketWin::Close() { read_watcher_.StopWatching(); write_watcher_.StopWatching(); + WSACloseEvent(read_overlapped_.hEvent); + memset(&read_overlapped_, 0xaf, sizeof(read_overlapped_)); + WSACloseEvent(write_overlapped_.hEvent); + memset(&write_overlapped_, 0xaf, sizeof(write_overlapped_)); + closesocket(socket_); socket_ = INVALID_SOCKET; } @@ -379,6 +384,7 @@ int UDPSocketWin::InternalRecvFrom(IOBuffer* buf, int buf_len, DWORD flags = 0; DWORD num; + CHECK_NE(INVALID_SOCKET, socket_); AssertEventNotSignaled(read_overlapped_.hEvent); int rv = WSARecvFrom(socket_, &read_buffer, 1, &num, &flags, addr, &recv_addr_len_, &read_overlapped_, NULL); |