Skip to content

WiFiClient: don’t destroy ClientContext on ::stop #4389

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

Merged
merged 1 commit into from
Feb 20, 2018

Conversation

igrr
Copy link
Member

@igrr igrr commented Feb 19, 2018

Reported in #4078.

WiFiClient::stopAll, called from a WiFi disconnected event handler,
could be called while WiFiClient::connect was in progress. This issue
was initially fixed in #4194, by testing this pointer for being
non-null in ClientContext::connect.

This change delegates deletion of ClientContext to WiFiClient
destructor. WiFiClient::stop only calls ClientContext::stop, which
closes/aborts the connection.

@igrr igrr added this to the 2.4.1 milestone Feb 19, 2018
@igrr igrr requested a review from d-a-v February 19, 2018 13:30
@igrr
Copy link
Member Author

igrr commented Feb 19, 2018

@d-a-v This is the solution I mentioned in #4197, please have a look.

@igrr igrr force-pushed the bugfix/wificlient_stopall branch from a5a9ac4 to a4bc96c Compare February 19, 2018 17:16
@igrr
Copy link
Member Author

igrr commented Feb 19, 2018

Updated the PR to remove if(this != 0) check in ClientContext::unref.

Reported in #4078.

WiFiClient::stopAll, called from a WiFi disconnected event handler,
could be called while WiFiClient::connect was in progress. This issue
was initially fixed in #4194, by testing `this` pointer for being
non-null in ClientContext::connect.

This change delegates deletion of ClientContext to WiFiClient
destructor. WiFiClient::stop only calls ClientContext::stop, which
closes/aborts the connection.
@igrr igrr force-pushed the bugfix/wificlient_stopall branch from a4bc96c to 8e6d4c4 Compare February 19, 2018 17:18
Copy link
Collaborator

@d-a-v d-a-v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with no reserve :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants