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

websocket: preserve user type #159

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

Conversation

briot
Copy link
Contributor

@briot briot commented Jun 25, 2020

A fix for #138, which I have been using for 2 years now. It preserves the websocket object created by the user.

@briot
Copy link
Contributor Author

briot commented May 4, 2021

Hello,
any news on this patch ? it seems to fix the issue reported by Maxim in #138, but I haven't seen any conversation here ?

@TurboGit
Copy link
Collaborator

TurboGit commented May 4, 2021

@briot : Sorry I read the WIP in the header as a non finalized PR and I expected that you would amend it somehow. Will have a look soon.

@briot briot changed the title Wip/websocket setup websocket: preserve user type May 5, 2021
briot added 2 commits May 6, 2021 09:34
This is needed to override On_Message and other callbacks, but previous
versions were destroying the object created by the user, and we thus
ended up with uninitialized fields.

Fixes AdaCore#138
@briot
Copy link
Contributor Author

briot commented May 6, 2021

I changed the patch to properly unregister the websocket as needed. The current behavior of Registry.Close is a bit surprising because it receives an Object and will internally lookup the corresponding pointer to free it (so although I pass WS.all, it actually frees WS). But I think this will be changed in the context of #209 anyway, so not important here.

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