Skip to content

Commit

Permalink
Fix a bug that using a destroyed connection object.
Browse files Browse the repository at this point in the history
there is a case that accessing a connection object which was destroyed by
ConnectionManager and TransportSubscriberLink/TransportPublicationLink
while getting a close event in pollset to call Connection::drop.

Signed-off-by: Barry Xu <Barry.Xu@sony.com>
  • Loading branch information
Barry-Xu-2018 committed May 18, 2020
1 parent 13017b5 commit 8f584bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clients/roscpp/src/libros/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,11 @@ void Connection::drop(DropReason reason)

if (did_drop)
{
transport_->close();
{
boost::recursive_mutex::scoped_lock lock(drop_mutex_);
drop_signal_(shared_from_this(), reason);
}
transport_->close();
}
}

Expand Down

0 comments on commit 8f584bc

Please sign in to comment.