Tel4tel
Tel4tel

Reputation: 51

BOOL - potential leak of an object

i am getting potential leak of an object allocated message. how can i dealloc it?

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

  extern BOOL _mainWebViewLoaded;  // **-> Potential leak of an object allocated

    Nimble *nimble = [[Nimble alloc] initWithRootPage:@"main.html" window:self.window serial:@""];
    [nimble release]; 
    [self.window makeKeyAndVisible];
    while (!_mainWebViewLoaded) {
        [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:1]];
    }
    return YES ;



}

Upvotes: 0

Views: 456

Answers (1)

Nathanial Woolls
Nathanial Woolls

Reputation: 5291

It's self.window that is leaked, not the BOOL. Autorelease your self.window:

self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];

The reasoning is explained well here.

Upvotes: 3

Related Questions