Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-07-2009, 05:20 AM   #1 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 22
harshal is on a distinguished road
Smile uialertview leaking with nsurlconnection or mbprogresshud or else ?

HI I have a private api class for a indicator view as taken from the following link :



MBProgressHUD for iPhone | Bukovinski



Now on that I am startin an synchronous request and after getting the data I am showing an alertview .



But Immidiatelly after that I am getting a 16 bytes leak .. On each call to the function It is repeated..



The function code is :
Code:
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/Service.asmx/insertFavourite?uid=2&restid=%@",[[NSUserDefaults standardUserDefaults] stringForKey:@"readOnly_key"],
                                                     [object.id stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]]];
     
          NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:10.0];
          [request setHTTPMethod:@"GET"];
          //[request setTimeoutInterval:10];
          //NSURLResponse *response = nil;
//          NSError *error = nil;
     [[NSURLCache sharedURLCache] setMemoryCapacity:0];
     [[NSURLCache sharedURLCache] setDiskCapacity:0];
          NSData *data1= [NSURLConnection sendSynchronousRequest:request          
                                                        returningResponse:nil error:nil];
          
          if(data1 == nil)
          {
               UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Alert"
                                                                         message:@"The network is not available.\n Please check the Internet connection."
                                                                        delegate:nil
                                                             cancelButtonTitle:@"OK"
                                                             otherButtonTitles:nil];
               [alert show];
               [alert release];
               
          }
          else
          {
               
               
               
               [favoritesButton setTitle:@"Remove" forState:UIControlStateNormal];
               UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Confirmation"
                                                                         message:@"Added To favorites" 
                                                                        delegate:nil
                                                             cancelButtonTitle:@"OKAY"
                                                             otherButtonTitles:nil];
               [alert show];

//***************************************instruments shows leak here *************************
               [alert release];
               
               
               
          }
          [request release];
In log I am gettin this :::
RestaurantApp(1802,0xb029a000) malloc: *** error for object 0x116c370: double free
*** set a breakpoint in malloc_error_break to debug

an the retain count of alert is getting 4 every time .. I haven't retained the alert object anywhere ????????????????
So what can be the possible reason . Is it something internal or my own ?

Last edited by harshal; 11-07-2009 at 06:17 AM.
harshal is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone, memory leak

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 343
11 members and 332 guests
alexP, ClerurcifeDer, Duncan C, givensur, glenn_sayers, guusleijsten, JmayLive, NetGuru, Punkjumper, whitey99, yys
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,114
Posts: 402,883
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:41 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0