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

Getting EXC_BAD_ACCESS exception #2

Open
erdnussflips opened this issue May 30, 2016 · 3 comments
Open

Getting EXC_BAD_ACCESS exception #2

erdnussflips opened this issue May 30, 2016 · 3 comments

Comments

@erdnussflips
Copy link

I'm getting an EXC_BAD_ACCESS exception at
(BOOL)_setCFClientFlags:(CFOptionFlags)inFlags callback:(CFReadStreamClientCallBack)inCallback context:(CFStreamClientContext *)inContext
in HSRandomDataInputStream on
copiedCallback((CFReadStreamRef)CFBridgingRetain(self), kCFStreamEventHasBytesAvailable, &copiedContext);

Do you have an idea?

@GregOriol
Copy link

I also have this issue when I try to use the HSRandomDataInputStream with Alamofire's upload and to an HTTPS url; it works with an HTTP url though; very strange?

@tomalakgeretkal
Copy link

I think some of the innards aren't necessarily set up yet when _setCFClientFlags first gets invoked on certain systems (I'm seeing this on macOS 10.14, but not 10.15). The copiedCallback invocation doesn't seem to be necessary here anyway, and this fork does away with it. I'll submit a PR.

@tomalakgeretkal
Copy link

Actually I'll leave the PR to someone else, but if you're only integrating with NSUrlSessions then you can skip all the callback invocations (in both read and setCFClientFlags).

Otherwise you'll need to be able to turn that on and off depending on the context. Look at https://github.com/pavelosipov/POSInputStreamLibrary for inspiration!

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

3 participants