update comments regarding converting shared_ptr to unique_ptr

This commit is contained in:
Steven Siloti 2016-04-30 10:50:42 -07:00
parent 82b599aa4b
commit bca41a681f
2 changed files with 4 additions and 2 deletions

View File

@ -166,7 +166,8 @@ namespace libtorrent
// the actual sockets (TCP listen socket and UDP socket)
// An entry does not necessarily have a UDP or TCP socket. One of these
// pointers may be null!
// TODO: 3 make these unique_ptr<>
// These must be shared_ptr to avoid a dangling reference if an
// incoming packet is in the event queue when the socket is erased
boost::shared_ptr<tcp::acceptor> sock;
boost::shared_ptr<udp_socket> udp_sock;
};

View File

@ -401,7 +401,8 @@ namespace libtorrent
mutable std::mutex m_mutex;
// maps transactionid to the udp_tracker_connection
// TODO: this should be unique_ptr in the future
// These must use shared_ptr to avoid a dangling reference
// if a connection is erased while a timeout event is in the queue
typedef boost::unordered_map<boost::uint32_t
, boost::shared_ptr<udp_tracker_connection> > udp_conns_t;
udp_conns_t m_udp_conns;