潜在泄漏? - 分析仪

时间:2009-12-11 04:11:02

标签: iphone c objective-c

分析状态泄漏问题,为什么?

+ (DebugOutput *) sharedDebug
    {
      @synchronized(self)
      {
        if (sharedDebugInstance == nil)
        {
          [[self alloc] init];
        }  
      }
      return sharedDebugInstance;
    }

1 个答案:

答案 0 :(得分:7)

没有分配好sharedDebugInstance,你可能想这样做:

sharedDebugInstance = [[self alloc] init];
相关问题