iPhone app memory leak with UIImage animation? Problem testing on device

Posted by user157733 on Stack Overflow See other posts from Stack Overflow or by user157733
Published on 2010-06-07T20:22:53Z Indexed on 2010/06/07 20:32 UTC
Read the original article Hit count: 473

I have an animation which works fine in the simulator but crashes on the device. I am getting the following error...

Program received signal: “0”. The Debugger has exited due to signal 10 (SIGBUS)

A bit of investigating suggests that the UIImages are not getting released and I have a memory leak. I am new to this so can someone tell me if this is the likely cause? If you could also tell me how to solve it then that would be amazing.

The images are 480px x 480px and about 25kb each. My code is below...

NSArray *rainImages = [NSArray arrayWithObjects:
                           [UIImage imageNamed:@"rain-loop0001.png"],
                           [UIImage imageNamed:@"rain-loop0002.png"],
                           [UIImage imageNamed:@"rain-loop0003.png"],
                           [UIImage imageNamed:@"rain-loop0004.png"],
                           [UIImage imageNamed:@"rain-loop0005.png"],
                           [UIImage imageNamed:@"rain-loop0006.png"],  
                           //more looping images
                           [UIImage imageNamed:@"rain-loop0045.png"],
                           [UIImage imageNamed:@"rain-loop0046.png"],
                           [UIImage imageNamed:@"rain-loop0047.png"],
                           [UIImage imageNamed:@"rain-loop0048.png"],
                           [UIImage imageNamed:@"rain-loop0049.png"],
                           [UIImage imageNamed:@"rain-loop0050.png"],
                           nil];


    rainImage.animationImages = rainImages;
    rainImage.animationDuration = 4.15/2;
    rainImage.animationRepeatCount = 0;
    [rainImage startAnimating];
    [rainImage release];

Thanks

© Stack Overflow or respective owner

Related posts about iphone

Related posts about memory-leaks