*** __NSAutoreleaseNoPool(): Object 0x926d620 of class NSPathStore2 autoreleased with no pool in place - just leaking

StackOverflow https://stackoverflow.com/questions/11623999

문제

My application is ARC enabled one.

In the app delegate i have written a code

[self performSelectorInBackground:@selector(initializeAnimationImageArrays) withObject:nil];

And my method is

- (void)initializeAnimationImageArrays
{
    NSArray *animationArray = [NSArray arrayWithObjects:
           [UIImage imageNamed:@"1.png"],
           [UIImage imageNamed:@"2.png"],
           [UIImage imageNamed:@"3.png"],
           nil];
}

I have seen some error messages as given below

*** __NSAutoreleaseNoPool(): Object 0x926d620 of class NSPathStore2 autoreleased with no pool in place - just leaking

I fixed this issue by modifying the method as below.

@autoreleasepool
{ 
   NSArray *animationArray = [NSArray arrayWithObjects:
          [UIImage imageNamed:@"1.png"],
          [UIImage imageNamed:@"2.png"],
          [UIImage imageNamed:@"3.png"],
          nil];
}

Can anyone please explain to me, what is happening in this context.

도움이 되었습니까?

해결책

It says you do not have an autorelease pool to manage autoreleased objects. By default, main thread will have its autorelease pool. When you create a thread you have to create an autorelease pool on your own.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top