BluesZhang / gdata-objectivec-client

Automatically exported from code.google.com/p/gdata-objectivec-client
Other
0 stars 0 forks source link

Memory leak with keepChildXMLElementsForElement #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Via CLANG

- (void)keepChildXMLElementsForElement:(NSXMLElement *)element {
1983     
[1] Taking true branch.
1984      if (shouldKeepChildXMLElements_) {
1985     
1986        NSArray *children = [element children];
[2] Taking true branch.
1987        if (children != nil) {
1988     
1989          // save only top-level nodes that are elements
1990          NSXMLNode *childNode;
1991     
1992          GDATA_FOREACH(childNode, children) {
[3] Taking true branch.
1993            if ([childNode kind] == NSXMLElementKind) {
[4] Taking false branch.
1994              if (childXMLElements_ == nil) {
1995                childXMLElements_ = [[NSMutableArray alloc] init];
1996              }
[5] Method returns an Objective-C object with a +1 retain count (owning 
reference).
1997              [childXMLElements_ addObject:[childNode copy]];
[6] Object allocated on line 1997 is no longer referenced after this point and 
has a retain count of 
+1 (object leaked).
1998     
1999              [self handleParsedElement:childNode];
2000            }
2001          }
2002        }
2003      }
2004    }
2005     

Original issue reported on code.google.com by alex...@gmail.com on 11 Feb 2009 at 5:13

GoogleCodeExporter commented 9 years ago
Thanks.

Original comment by gregrobbins on 11 Feb 2009 at 7:36