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

遇到内存泄漏问题 麻烦大神 #3

Closed
KelyCocoa opened this issue May 29, 2018 · 1 comment
Closed

遇到内存泄漏问题 麻烦大神 #3

KelyCocoa opened this issue May 29, 2018 · 1 comment

Comments

@KelyCocoa
Copy link

当router支持的路由类型是ZIKViewRouteTypeMaskViewDefault时Presenter如果强持有router会造成view的内存泄漏,这种情况下我觉得是router强制持有了绑定的view。我查看了一下源码,仍然没有找到问题的原因,希望大神指点,另外当router绑定的是controller类型时是正常的,view presenter Interactor 等的持有关系我反复核查过,问题并不出现在这个地方。谢谢

@Zuikyo
Copy link
Owner

Zuikyo commented May 29, 2018

应该不是 router 的问题,ZIKRouter 只会持有 destination 对象的弱引用。你可以参考一下ZIKViper的 demo 里的 TextWidgetViper 模块,也是用 UIView 作为 view,我用最新版的 ZIKRouter 测试,没有内存泄露。

你可以用 Xcode 的 Debug Memory Graph 工具看看 view 在内存泄露时被谁引用了。

@Zuikyo Zuikyo closed this as completed Jun 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants