提交 bbb53d0a 编写于 作者: Y yixiangboy

内存泄漏 循环引用内容上传到平台端

上级 8f9e8fef
......@@ -453,9 +453,12 @@
- (void)addLeak:(NSDictionary *)info{
if (_start) {
NSString *viewStack = info[@"viewStack"];
NSString *retainCycle = info[@"retainCycle"];
NSString *detail = [NSString stringWithFormat:@"viewStack : \n%@ \n\n retainCycle : \n%@\n\n",STRING_NOT_NULL(viewStack),STRING_NOT_NULL(retainCycle)];
[_leakArray addObject:@{
@"page":info[@"className"],
@"detail":info[@"viewStack"]
@"detail":detail
}];
}
}
......
......@@ -5,12 +5,13 @@
// Created by didi on 2019/10/7.
//
#import "MLeaksFinder.h"
#import "DoraemonMemoryLeakData.h"
#import "NSObject+MemoryLeak.h"
#if _INTERNAL_MLF_RC_ENABLED
#import <FBRetainCycleDetector/FBRetainCycleDetector.h>
#endif
#import "DoraemonHealthManager.h"
#import "DoraemonDefine.h"
@interface DoraemonMemoryLeakData()
......@@ -41,16 +42,13 @@
NSString *className = NSStringFromClass([object class]);
NSNumber *classPtr = @((uintptr_t)object);
NSArray *viewStack = [object viewStack];
//NSString *retainCycle = [self getRetainCycleByObject:object];
NSString *retainCycle = @"retainCycle";
NSString *retainCycle = [self getRetainCycleByObject:object];
NSDictionary *info = @{
@"className":className,
@"classPtr":classPtr,
@"viewStack":viewStack,
@"retainCycle":retainCycle
@"className":STRING_NOT_NULL(className),
@"classPtr":STRING_NOT_NULL(classPtr),
@"viewStack":STRING_NOT_NULL(viewStack),
@"retainCycle":STRING_NOT_NULL(retainCycle)
};
[_dataArray addObject:info];
[[DoraemonHealthManager sharedInstance] addLeak:info];
......
......@@ -9,7 +9,6 @@
#import "MLeakedObjectProxy.h"
#import "MLeaksFinder.h"
#import "MLeaksMessenger.h"
#import "NSObject+MemoryLeak.h"
#import <objc/runtime.h>
#import <UIKit/UIKit.h>
#import "DoraemonMemoryLeakData.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册