You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Andrew McGeachie (JIRA)" <ji...@apache.org> on 2009/07/21 19:32:14 UTC
[jira] Resolved: (THRIFT-545) Memory leak in obj-c "description"
method
[ https://issues.apache.org/jira/browse/THRIFT-545?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrew McGeachie resolved THRIFT-545.
-------------------------------------
Resolution: Fixed
Commited.
> 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
> Attachments: thrift-545.patch
>
>
> The implementation of the 'description' method in objective-c leaks an object. e.g.:
> {code}
> - (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];
> }
> {code}
> 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.