I'm don't know anything about autorelease semantics, but it seems a bit worrying that set_window_title makes some GC-related action on ns_title (autorelease) whereas choose_save_file doesn't, just using title and ns_default_filename directly. Or perhaps nothing matters and the autorelease in set_window_title is redundant?
ns_default_filename is released on the next line, so it's fine. I think title is fine too, as we didn't call alloc explicitly, so it defaults to autorelease, according to https://stackoverflow.com/a/2713941
Activity
QuLogic commented on Nov 23, 2021
ns_default_filename is released on the next line, so it's fine. I think title is fine too, as we didn't call alloc explicitly, so it defaults to autorelease, according to https://stackoverflow.com/a/2713941
QuLogic commented on Nov 23, 2021
OK, the links from SO were broken, but I think I've found the archived docs which explains it.
Basically,
We should probably just use the default constructor and not bother with explicit release or autorelease.
dstansby commented on Jan 2, 2023
Is this fixed by #23060 and/or #23558?
anntzer commented on Jan 2, 2023
Hard for me to judge, but at least the offending code isn't there anymore.
QuLogic commented on Jan 4, 2023
I think #23060 is likely to have fixed it.