Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix possible dangling pointer #698

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class local_tcp_server_endpoint_impl
bool add_connection(const client_t &_client,
const std::shared_ptr<connection> &_connection);
void remove_connection(const client_t &_client);
void accept_cbk(const connection::ptr& _connection,
void accept_cbk(connection::ptr _connection,
boost::system::error_code const &_error);
std::string get_remote_information(
const target_data_iterator_type _queue_iterator) const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class tcp_server_endpoint_impl: public tcp_server_endpoint_base_impl {

private:
void remove_connection(connection *_connection);
void accept_cbk(const connection::ptr& _connection,
void accept_cbk(connection::ptr _connection,
boost::system::error_code const &_error);
std::string get_remote_information(
const target_data_iterator_type _it) const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ void local_tcp_server_endpoint_impl::remove_connection(
}

void local_tcp_server_endpoint_impl::accept_cbk(
const connection::ptr& _connection, boost::system::error_code const &_error) {
connection::ptr _connection, boost::system::error_code const &_error) {
if (_error != boost::asio::error::bad_descriptor
&& _error != boost::asio::error::operation_aborted
&& _error != boost::asio::error::no_descriptors) {
Expand Down
2 changes: 1 addition & 1 deletion implementation/endpoints/src/tcp_server_endpoint_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ void tcp_server_endpoint_impl::remove_connection(
}
}

void tcp_server_endpoint_impl::accept_cbk(const connection::ptr& _connection,
void tcp_server_endpoint_impl::accept_cbk(connection::ptr _connection,
boost::system::error_code const &_error) {

if (!_error) {
Expand Down