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 two crashes when using websocketpp as a client library #1041

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Radrik5
Copy link

@Radrik5 Radrik5 commented May 24, 2022

The first part continues fix from PR #539: references to alog and elog were fixed (replaced with shared_ptr) but reference to rng was not. If rng is accessed after endpoint is destroyed, application crashes.

The second part fixes crash in endpoint::handle_connect() called when endpoint is already destroyed. The fix is to capture shared_ptr instead of raw this pointer (similar to callbacks in connection).

The crashes occurred regularly in automated tests for application that creates and destroys endpoint for each client connection.

Replace references with lib::shared_ptr.
Capture this by shared_ptr in asio callbacks.
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.

1 participant