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

retain loops #95

Open
wtholliday opened this issue Jun 23, 2019 · 0 comments
Open

retain loops #95

wtholliday opened this issue Jun 23, 2019 · 0 comments
Labels

Comments

@wtholliday
Copy link
Member

In AudioKitSynthOne/Manager/Manager+callbacks.swift, retain loops are created by the callbacks. Search for callback = { in your codebase and you'll find more.

The callbacks need to be of the form

myWidget.callback = { [weak self] in
   guard let strongSelf = self else { return }
  // do stuff with strongSelf
}

This isn't a big deal for a stand-alone app (though, it's considered bad form), but if you ever want to make an AudioUnit Extension, the leaks will become an issue.

Timers are also a source of retain loops, as well as simply creating cycles between view controllers, etc.

You can use Xcode's Memory Graph Debugger to find them, though it's still not very easy.

@sieren sieren added the bug label Sep 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants