We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
背景: 我的项目中所有 VC 都继承于一个 baseVC : UIViewController, baseVC 里面有一个方法叫 loadingHUD。 loadingHUD 是用来显示 MBProgressHUD 的。
现象: 加入 PLeakSniffer 并使用后,发现所有它会自动调用 loadingHUD。 断点得出的路径是:[vc viewDidAppear:] -> [baseVC viewDidAppear:] -> [UIViewController (PLeak) swizzled_viewDidAppear:] -> [NSObject(PLeakTrack) watchAllRetainedProperties:] -> [baseVC loadingHUD]
出需要注意的是,viewDidAppear 并没有处理任何事务。(only [super viewDidAppear:animated];)
莫名其妙。
The text was updated successfully, but these errors were encountered:
将https://github.com/music4kid/PLeakSniffer/blob/master/PLeakSniffer/Classes/NSObject%2BPLeakTrack.m#L56 这里改成下面的代码可以去掉调用getter引来的副作用
NSString *s = [NSString stringWithFormat:@"_%@", name]; // 不触发getter Ivar nameIVar = class_getInstanceVariable(self.class, [s UTF8String]); if (nameIVar) { id cur = object_getIvar(self, nameIVar); }
Sorry, something went wrong.
将https://github.com/music4kid/PLeakSniffer/blob/master/PLeakSniffer/Classes/NSObject%2BPLeakTrack.m#L56 这里改成下面的代码可以去掉调用getter引来的副作用 NSString *s = [NSString stringWithFormat:@"_%@", name]; // 不触发getter Ivar nameIVar = class_getInstanceVariable(self.class, [s UTF8String]); if (nameIVar) { id cur = object_getIvar(self, nameIVar); }
发生崩溃在 id cur = object_getIvar(self, nameIVar);
id cur = object_getIvar(self, nameIVar);
No branches or pull requests
背景:
我的项目中所有 VC 都继承于一个 baseVC : UIViewController, baseVC 里面有一个方法叫 loadingHUD。
loadingHUD 是用来显示 MBProgressHUD 的。
现象:
加入 PLeakSniffer 并使用后,发现所有它会自动调用 loadingHUD。
断点得出的路径是:[vc viewDidAppear:] -> [baseVC viewDidAppear:] -> [UIViewController (PLeak) swizzled_viewDidAppear:] -> [NSObject(PLeakTrack) watchAllRetainedProperties:] -> [baseVC loadingHUD]
出需要注意的是,viewDidAppear 并没有处理任何事务。(only [super viewDidAppear:animated];)
莫名其妙。
The text was updated successfully, but these errors were encountered: