How i solve memory leak problem?

Posted by RRB on Stack Overflow See other posts from Stack Overflow or by RRB
Published on 2010-12-21T11:43:47Z Indexed on 2010/12/21 11:53 UTC
Read the original article Hit count: 180

Filed under:

Hi, I developing an simple application in which design or make code in which i creating and instance object of UIImage. When i swip on Ipad screen it make up an image of the sreen and that image i render into UIImage object after that this image i set into UIImageView object and UIimage object is released. Every time i swipe on the screen and above process is does again and again. But it give me leak in renderImage = [[UIImage alloc] init];.

Code,

_renderImage = [[UIImage alloc] init];

_textImageV = [[UIImageView alloc] init];

[self renderIntoImage];

-(void)renderIntoImage
{

    UIGraphicsBeginImageContext(bgTableView.bounds.size);
    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
    _renderImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
}

 _textImageV.image = _renderImage;
[_renderImage release];

after completing the process of swipe i also releasing _textImageV.

How i solve the memory leak problem in UIImage *_renderImage?

© Stack Overflow or respective owner

Related posts about ipad