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

Side by Side Diff: runtime/bin/socket.h

Issue 1781883002: Fixes some memory leaks in //runtime/bin (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix tests on Windows Created 4 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
« no previous file with comments | « runtime/bin/process_win.cc ('k') | runtime/bin/socket_android.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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef BIN_SOCKET_H_ 5 #ifndef BIN_SOCKET_H_
6 #define BIN_SOCKET_H_ 6 #define BIN_SOCKET_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "platform/globals.h" 10 #include "platform/globals.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 public: 182 public:
183 explicit InterfaceSocketAddress(struct sockaddr* sa, 183 explicit InterfaceSocketAddress(struct sockaddr* sa,
184 const char* interface_name, 184 const char* interface_name,
185 intptr_t interface_index) 185 intptr_t interface_index)
186 : socket_address_(new SocketAddress(sa)), 186 : socket_address_(new SocketAddress(sa)),
187 interface_name_(interface_name), 187 interface_name_(interface_name),
188 interface_index_(interface_index) {} 188 interface_index_(interface_index) {}
189 189
190 ~InterfaceSocketAddress() { 190 ~InterfaceSocketAddress() {
191 delete socket_address_; 191 delete socket_address_;
192 free(const_cast<char*>(interface_name_));
193 } 192 }
194 193
195 SocketAddress* socket_address() const { return socket_address_; } 194 SocketAddress* socket_address() const { return socket_address_; }
196 const char* interface_name() const { return interface_name_; } 195 const char* interface_name() const { return interface_name_; }
197 int interface_index() const { return interface_index_; } 196 int interface_index() const { return interface_index_; }
198 197
199 private: 198 private:
200 SocketAddress* socket_address_; 199 SocketAddress* socket_address_;
201 const char* interface_name_; 200 const char* interface_name_;
202 intptr_t interface_index_; 201 intptr_t interface_index_;
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 414
416 private: 415 private:
417 DISALLOW_COPY_AND_ASSIGN(ListeningSocketRegistry); 416 DISALLOW_COPY_AND_ASSIGN(ListeningSocketRegistry);
418 }; 417 };
419 418
420 419
421 } // namespace bin 420 } // namespace bin
422 } // namespace dart 421 } // namespace dart
423 422
424 #endif // BIN_SOCKET_H_ 423 #endif // BIN_SOCKET_H_
OLDNEW
« no previous file with comments | « runtime/bin/process_win.cc ('k') | runtime/bin/socket_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698