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

NSAutoreleasePool no longer needed? #1060

Open
pedro-w opened this issue May 20, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@pedro-w
Copy link
Contributor

commented May 20, 2019

There are many uses of NSAutoreleasePool in the MacOs code, which I remember needed to be added otherwise we'd get "Autoreleased with no pool in place".
e.g.

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

Many were added in commit 9acf685
However when I deleted one, nothing happened. Maybe they are not needed anymore. Does anyone know if changes to Cocoa's memory management have changed things. I know that since 10.7, automatic reference counting has been introduced and it's preferable to use @autoreleasepool ( link )
Does anyone know for sure? I'm thinking that constantly creating and deleting these pools is going to be overhead, and also complicates the flow as we need to drain and release them on every exit path from the function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.