Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TWRequest leaking?

Im using TWRequest in ios5 but Leaks is reporting a memory leak for TWRequest.

I'm doing something like this, am I going wrong somewhere?

TWRequest *postRequest = [[TWRequest alloc] initWithURL:[NSURL URLWithString:@"http://api.twitter.com/1/friendships/create.json"] parameters:[NSDictionary dictionaryWithObject:@"auser"  forKey:@"screen_name"] requestMethod:TWRequestMethodPOST];

 // Set the account used to post the tweet.
 [postRequest setAccount:twitterAccount];

 // Perform the request created above and create a handler block to handle the response.
 [postRequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
       NSString *output = [NSString stringWithFormat:@"HTTP response status: %i", [urlResponse statusCode]];

       [TWRequest release];
 }];
like image 323
cal Avatar asked Jul 14 '26 01:07

cal


1 Answers

You'll want to change [TWRequest release]; to [postRequest release];

like image 130
hypercrypt Avatar answered Jul 15 '26 15:07

hypercrypt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!