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

libwebsocket_context_destroy crashes #89

Open
pierdr opened this issue Sep 19, 2016 · 1 comment
Open

libwebsocket_context_destroy crashes #89

pierdr opened this issue Sep 19, 2016 · 1 comment

Comments

@pierdr
Copy link

pierdr commented Sep 19, 2016

Hi,
I'm using ofxLibwebsocket as a client and it works, but as soon as the server goes offline the sketch crashes at line 284 of Client.cpp:
https://github.com/robotconscience/ofxLibwebsockets/blob/master/libs/ofxLibwebsockets/src/Client.cpp#L284
libwebsocket_context_destroy( context );

And the error is the following:
malloc: *** error for object 0x600000221c20: pointer being freed was not allocated


Context is never null when the program arrives there.

Ideas?

@robotconscience
Copy link
Owner

Hey @pierdr! Sorry you're having this issue. I think I've seen it before, but thought it was fixed.

My fear is it's something internal with lws; you can see we're pretty out-of-date relative to their whole library. Haven't had time to do a re-write, as they've changed their API. You might be able to build one of their 1.5+ versions (1.7 is a new rewrite) and drop that in?

You might be able to swap in the newer c++11 if ( context != nullptr ){ but I don't think that'll make a difference just yet. You may also be able to manually close the socket if you get an onClose event.

Will think on it more–apologies the libraries are so out of date!

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

No branches or pull requests

2 participants