Skip to content

Commit

Permalink
Also fix this use of auto_ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Thorson committed Jan 31, 2016
1 parent ed335a3 commit e036a5a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion websocketpp/transport/asio/endpoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,15 @@ class endpoint : public config::socket_type {
* @see init_asio(io_service_ptr ptr)
*/
void init_asio() {
// Use a smart pointer until the call is successful and ownership transferred
// Use a smart pointer until the call is successful and ownership has
// successfully been taken. Use unique_ptr when available.
// TODO: remove the use of auto_ptr when C++98/03 support is no longer
// necessary.
#ifdef _WEBSOCKETPP_CPP11_MEMORY_
lib::unique_ptr<lib::asio::io_service> service(new lib::asio::io_service());
#else
lib::auto_ptr<lib::asio::io_service> service(new lib::asio::io_service());
#endif
init_asio( service.get() );
// If control got this far without an exception, then ownership has successfully been taken
service.release();
Expand Down

0 comments on commit e036a5a

Please sign in to comment.