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

Side by Side Diff: src/platform-win32.cc

Issue 42331: Fixed memory leaks in socket implementation (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/platform-macos.cc ('k') | test/cctest/test-sockets.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after
1629 hints.ai_family = AF_INET; 1629 hints.ai_family = AF_INET;
1630 hints.ai_socktype = SOCK_STREAM; 1630 hints.ai_socktype = SOCK_STREAM;
1631 hints.ai_protocol = IPPROTO_TCP; 1631 hints.ai_protocol = IPPROTO_TCP;
1632 int status = getaddrinfo(host, port, &hints, &result); 1632 int status = getaddrinfo(host, port, &hints, &result);
1633 if (status != 0) { 1633 if (status != 0) {
1634 return false; 1634 return false;
1635 } 1635 }
1636 1636
1637 // Connect. 1637 // Connect.
1638 status = connect(socket_, result->ai_addr, result->ai_addrlen); 1638 status = connect(socket_, result->ai_addr, result->ai_addrlen);
1639 freeaddrinfo(result);
1639 return status == 0; 1640 return status == 0;
1640 } 1641 }
1641 1642
1642 1643
1643 int Win32Socket::Send(const char* data, int len) const { 1644 int Win32Socket::Send(const char* data, int len) const {
1644 int status = send(socket_, data, len, 0); 1645 int status = send(socket_, data, len, 0);
1645 return status; 1646 return status;
1646 } 1647 }
1647 1648
1648 1649
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1807 1808
1808 // Release the thread handles 1809 // Release the thread handles
1809 CloseHandle(data_->sampler_thread_); 1810 CloseHandle(data_->sampler_thread_);
1810 CloseHandle(data_->profiled_thread_); 1811 CloseHandle(data_->profiled_thread_);
1811 } 1812 }
1812 1813
1813 1814
1814 #endif // ENABLE_LOGGING_AND_PROFILING 1815 #endif // ENABLE_LOGGING_AND_PROFILING
1815 1816
1816 } } // namespace v8::internal 1817 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-macos.cc ('k') | test/cctest/test-sockets.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698