-1

analyze state leak problem, why?

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

1 Answers1

7

Well sharedDebugInstance is not assigned, you probably wanted to do that:

sharedDebugInstance = [[self alloc] init];
nico
  • 1,778
  • 1
  • 9
  • 8
  • have a look to this post as well: http://stackoverflow.com/questions/145154/what-does-your-objective-c-singleton-look-like – nico Dec 11 '09 at 04:17