ICoder
ICoder

Reputation: 1347

Memory leaks doubts in iphone

I have tested my application with leak instrument.There is only one leak in my application.It came from a array declaration.But i didn't know how to solve this.This is my array code.These three code is leaked.Please do help me.

allSelectedVerseEnglish = [[NSMutableArray alloc] init];

    allSelectedVerseMalayalam = [[NSMutableArray alloc] init];

    allSelectedVerseHindi = [[NSMutableArray alloc] init];

Thanks in advance.

Upvotes: 0

Views: 55

Answers (1)

sElanthiraiyan
sElanthiraiyan

Reputation: 6268

Just release the arrays when u don't need them anymore, say in dealloc method

[allSelectedVerseEnglish release];
[allSelectedVerseMalayalam release];
[allSelectedVerseHindi release];

or else you could simple use convenience constructors as below, (you dont have to release)

allSelectedVerseHindi = [NSMutableArray array];
allSelectedVerseMalayalam = [NSMutableArray array];
allSelectedVerseHindi = [NSMutableArray array];

Upvotes: 2

Related Questions