MLeaksFinder icon indicating copy to clipboard operation
MLeaksFinder copied to clipboard

调用popViewControllerAnimated不提示内存泄露,系统 navigation 的侧滑返回以及点返回按钮都提示内存泄露

Open MR-yo opened this issue 8 years ago • 2 comments

调用popViewControllerAnimated不提示内存泄露。 没有检测到循环引用。 利用 instruments 的 leaks 也没有发现内存泄露。 但是我用系统 navigation 的侧滑返回以及点返回按钮都提示内存泄露 help...

MR-yo avatar May 03 '17 03:05 MR-yo

  1. 先确定是不是真的泄漏了,在报泄露的对象的 dealloc 里加断点。(现在 MLeaksFinder 的机制是不会误报的,只不过你要区分报泄漏的原因,是因为单例,还是释放不及时,还是真的泄漏)
  2. 找出泄漏的原因并修复

Zepo avatar May 03 '17 03:05 Zepo

谢谢指导,最后发现在一个 block 里没写 weak-strong dance。 但是为什么我用 [self.navigationController popViewControllerAnimated:YES]; 的时候,MLeaksFinder并没有提示我泄漏呢?

MR-yo avatar May 03 '17 04:05 MR-yo