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

Opt out exceptions #250

Closed
hovox opened this issue May 19, 2016 · 2 comments
Closed

Opt out exceptions #250

hovox opened this issue May 19, 2016 · 2 comments
Assignees

Comments

@hovox
Copy link

hovox commented May 19, 2016

Exception handling is not recommended in Objective-C, and by default it's turned off, so in case of exceptions there will be memory leaks.

Can we have a way to opt out exceptions ? For example with some macro, if macro is defined, then skip @try/@catch . Thanks in advance.

@nlutsenko
Copy link
Member

This actually is a wonderful idea.
Exceptions are pretty bad anyway and I do agree that it's better to crash and get a stack trace than to try/catch and fail a network request and be in an unknown state.

We can do in a macro way, but then you wouldn't be able to opt-out of this in the case of dynamic frameworks, which probably is a good thing to cover.

Since we have Bolts as a source file - I think adding 2 extra C functions (getter and setter) would work probably best.

@hovox
Copy link
Author

hovox commented May 20, 2016

Agree, that would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants