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

cleanup fixes in linux-tcp #235

Merged
merged 2 commits into from
Jun 24, 2018

Conversation

pabigot
Copy link
Contributor

@pabigot pabigot commented Jun 24, 2018

There's a unit test for Monitor that could be included if #234 is merged first.

  • Monitor: avoid null pointer dereference when copying instances

    When the copy constructor was added to allow passing a monitor by value
    into a lambda the implementation did not account for the possibility of
    the watchable having already been destroyed.

    Also provide the companion copy assignment to complete the triad.

  • TcpResolver: reduce risk of accessing destructed TcpConnection

    Invoking TcpHandler::onError might result in the connection being
    destroyed. Though the reference to it in TcpClosed() is likely benign,
    it's safer to follow the standard practice of returning a nullptr to
    indicate that the connection is known to be destroyed.

pabigot added 2 commits June 24, 2018 10:31
Invoking TcpHandler::onError might result in the connection being
destroyed.  Though the reference to it in TcpClosed() is likely benign,
it's safer to follow the standard practice of returning a nullptr to
indicate that the connection is known to be destroyed.
When the copy constructor was added to allow passing a monitor by value
into a lambda the implementation did not account for the possibility of
the watchable having already been destroyed.

Also provide the companion copy assignment to complete the triad.
@EmielBruijntjes EmielBruijntjes merged commit 6827231 into CopernicaMarketingSoftware:master Jun 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants