-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CBL-5418 : Ensure to disconnect from the remote before CBLWebSocket b…
…eing dealloc (#3240) * Ported the fix (159c4ee) from release/3.1 branch. * It is possible that the dispose() function is called by the c4socket before the disconnect() function is called. One of the cases is when c4socket calls the dispose() as the close timeout is reached. * The fix ensures that when the dispose() is called, the disconnect() function will be called if the connection hasn’t been not closed yet. * The fix also make sure that the crash doesn’t happen after the c4socket is freed while there are pending tasks in the queue being run at the same time and might access it after it’s freed. This requires to use a lock to prevent this. * Added message to the assertions.
- Loading branch information
Showing
1 changed file
with
48 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters