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:14:15 UTC

[jira] Created: (THRIFT-545) Memory leak in obj-c "description" method

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.


[jira] Updated: (THRIFT-545) Memory leak in obj-c "description" method

Posted by "Andrew McGeachie (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-545?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew McGeachie updated THRIFT-545:
------------------------------------

    Attachment: thrift-545.patch

Patch which replaces:

{code}
return [ms copy];
{code}

with:

{code}
return [NSString stringWithString: ms];
{code}



> 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.


[jira] Updated: (THRIFT-545) Memory leak in obj-c "description" method

Posted by "Andrew McGeachie (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-545?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew McGeachie updated THRIFT-545:
------------------------------------

    Description: 
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.

  was:
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.


> 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.:
> {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.


[jira] Resolved: (THRIFT-545) Memory leak in obj-c "description" method

Posted by "Andrew McGeachie (JIRA)" <ji...@apache.org>.
     [ 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.