nil*_*nil -1 c iphone objective-c
分析状态泄漏问题,为什么?
+ (DebugOutput *) sharedDebug
{
@synchronized(self)
{
if (sharedDebugInstance == nil)
{
[[self alloc] init];
}
}
return sharedDebugInstance;
}
Run Code Online (Sandbox Code Playgroud)
好的sharedDebugInstance没有分配,你可能想这样做:
sharedDebugInstance = [[self alloc] init];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
199 次 |
| 最近记录: |