websocketpp
websocketpp copied to clipboard
Fix two crashes when using websocketpp as a client library
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.