Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 679723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:17:31+00:00 2026-05-14T01:17:31+00:00

I am getting leak at [pool release]; My code here is: #pragma mark UISearchBarDelegate

  • 0

I am getting leak at [pool release];

My code here is:

#pragma mark UISearchBarDelegate delegate methods


- (void)performSearch:(UISearchBar *)aSearchBar
{

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

artistName= [aSearchBar.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if ([artistName length] > 0) 
{

    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;

    LyricsAppDelegate* appDelegate =  (LyricsAppDelegate*) [ [UIApplication sharedApplication] delegate];
    artistsList=[appDelegate doSearch:artistName ];
    [theTableView reloadData];
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;


    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;


    [aSearchBar resignFirstResponder];
}
else
{
    [aSearchBar resignFirstResponder];
}
[NSThread exit];
[pool release]; 

}

- (void)searchBarSearchButtonClicked:(UISearchBar *)aSearchBar
{
@try {
    [NSThread detachNewThreadSelector:@selector(performSearch:) toTarget:self withObject:aSearchBar];
    [aSearchBar resignFirstResponder];
}
@catch (NSException * e) {
    NSLog(@"\n caught an exception");
}
@finally {
}
}

Here I am getting leak at [pool release]; in performSearch method.

How can I solve this.

Anyone’s help will be much appreciated.

Thank you,
Monish.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:17:31+00:00Added an answer on May 14, 2026 at 1:17 am

    Try to release pool before you exit current thread?

    ...
    [pool release]; 
    [NSThread exit];
    

    Edit: From NSThread -exit reference:

    Invoking this method should be avoided
    as it does not give your thread a
    chance to clean up any resources it
    allocated during its execution.

    Do you really need to call this function BTW?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting leak at below code: search.h NSString *str; search.m -(void)searchMethod:(UISearchBar *)aSearchBar {
I am getting memory leak in instruments in the code -(void)connectionDidFinishLoading:(NSURLConnection *)connection { NSAutoreleasePool
I am using protocol,and getting leak, Here is my code : + (id<GMGridViewLayoutStrategy>)strategyFromType:(GMGridViewLayoutStrategyType)type {
I getting leak here which is written in the appDelegate.m -(NSMutableArray*)getSalutationList { NSMutableArray *list=[[NSMutableArray
I am getting leak in following code. Leak percentage @ the end of the
I am getting a memory leak in my objective-C code that I don't understand.
I'm getting an analyser leak, however this is the same code i'm using elsewhere
I'm getting an instruments Memory Leak with this iPhone 3.0 SDK code. I'm using
I am getting another memory leak in a non-void instance method that returns a
Hi I am getting a reported leak from Instrument with the following code. dispatch_async(requestQueue,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.