-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Memory leaks #142
Comments
anybody is alive? |
This behavior is by design; it isn't an actual leak in BlocksKit. Blocks retain the objects referenced inside the block's scope, so this will cause a retain cycle if the block references something that retains the view. For example, if you add a block to a view from within a view controller's To fix this yourself, you'll want to
You could also use libextobjc's strongify and weakify macros to do it, same type of thing but prettier. Alternatively, we could add a method to BlocksKit to remove all view blocks and forcibly break the cycles, but it's better in my humble opinion if you know why it's happening yourself. ;-) |
Thanks for answer. |
Every single usage of something like this
cause a memory leak like this
The text was updated successfully, but these errors were encountered: