Memory leak in obj-c "description" method
-----------------------------------------

                 Key: THRIFT-545
                 URL: https://issues.apache.org/jira/browse/THRIFT-545
             Project: Thrift
          Issue Type: Bug
          Components: Compiler (Cocoa)
            Reporter: Andrew McGeachie
            Assignee: Andrew McGeachie


The implementation of the 'description' method in objective-c leaks an object.  
e.g.:

- (NSString *) description {
  NSMutableString * ms = [NSMutableString stringWithString: @"SavedSearch("];
  [ms appendString: @"guid:"];
  [ms appendFormat: @"\"%...@\"", __guid];
  [ms appendString: @",name:"];
  [ms appendFormat: @"\"%...@\"", __name];
  [ms appendString: @",query:"];
  [ms appendFormat: @"\"%...@\"", __query];
  [ms appendString: @",format:"];
  [ms appendFormat: @"%i", __format];
  [ms appendString: @",updateSequenceNum:"];
  [ms appendFormat: @"%i", __updateSequenceNum];
  [ms appendString: @")"];
  return [ms copy];
}

On the last line, the object returned by "[ms copy]" is retained, and needs to 
be autoreleased.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to