This repository has been archived by the owner on Aug 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 153
楼主,你的这个框架会内存泄露啊 #3
Comments
你好,可否提供这个Demo与我了解一下。 |
你在第二个 item 进去-->next-->touch一下-->马上 pop 回去,就会看到内存泄露的弹框 |
我看了下,定时器在没有调用hide方法就返回而导致,应该是类方法中的objc函数可能导致, |
其实这个是objc_setAssociatedObject的OBJC_ASSOCIATION_RETAIN_NONATOMIC导致的,但是您的换成OBJC_ASSOCIATION_ASSIGN会崩溃 |
Yeah ,这个我有测试过,所以现在迫于所学有限,不好下手啊。😂 |
根据WWDC 2011, Session 322 (第36分钟左右)发布的内存销毁时间表,被关联的对象在生命周期内要比对象本身释放的晚很多。它们会在被 NSObject -dealloc 调用的 object_dispose() 方法中释放。 |
🙂 好。 |
如上所言,我参考了MBProgressHUD,移除了OBJC相关方法,使用+hideForView:(UIView *)view来实现隐藏的目的。 |
@xeroxmx 学习了一波,兄弟能提供下内存泄露的一些解决方法吗?目前使用MLeaksFinder,有时就算知道哪里出了问题,也有些无从下手的感觉,不知道如何修改 |
@zzgo 也苦恼于内存泄露的代码在哪里, MLeaksFinder只会显示类,不会显示具体的哪一些代码内存,上次遇到 SEL 作为属性用 strong,结果内存泄漏了,找了半天才找到,要用 weak |
😂 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
我在一个 navigationController 放 JHUD,当我 pop 回去的时候,就发现内存泄露了
2016-08-04 23:18:38.458 CBWEmptyViewDemo[913:20546] Memory Leak: (
TestViewController,
UIView,
JHUD
)
The text was updated successfully, but these errors were encountered: