Permalink
Browse files

Fixed several memory leaks (say hello to static analizer).

  • Loading branch information...
tomaz committed Sep 15, 2009
1 parent 56d91f9 commit cbde3a7c1bfb6afd17518b92e6b4f6dd244b432a
Showing with 8 additions and 1 deletion.
  1. +1 −1 Systemator.m
  2. +5 −0 XMLOutputGenerator.m
  3. +2 −0 appledoc.xcodeproj/project.pbxproj
View
@@ -282,7 +282,7 @@ + (NSMutableArray*) linesFromContentsOfFile:(NSString*) filename
+ (void) writeLines:(NSArray*) lines toFile:(NSString*) filename
{
// Generate the string containing all lines.
- NSMutableString* string = [[NSMutableString alloc] init];
+ NSMutableString* string = [NSMutableString string];
for (NSString* line in lines)
{
[string appendString:line];
View
@@ -332,6 +332,7 @@ - (void) mergeCleanCategoriesToKnownObjects
[nameNode setStringValue:classSectionName];
}
[classSectionsNode addChild:classSectionNode];
+ [classSectionNode release];
}
}
else
@@ -350,6 +351,7 @@ - (void) mergeCleanCategoriesToKnownObjects
{
NSXMLElement* classMemberNode = [memberNode copy];
[sectionNode addChild:classMemberNode];
+ [classMemberNode release];
}
// Append the section data to the main class document.
@@ -380,6 +382,7 @@ - (void) mergeCleanCategoriesToKnownObjects
index);
NSXMLElement* insertedNode = [categoryFileNode copy];
[parentNode insertChild:insertedNode atIndex:index + 1];
+ [insertedNode release];
index++;
}
}
@@ -484,6 +487,7 @@ - (void) createCleanIndexDocumentationFile
// Save the markup.
NSError* error = nil;
NSData* markupData = [document XMLDataWithOptions:NSXMLNodePrettyPrint];
+ [document release];
NSString* filename = [self outputBasePath];
filename = [filename stringByAppendingPathComponent:[self outputIndexFilename]];
if (![markupData writeToFile:filename options:0 error:&error])
@@ -601,6 +605,7 @@ - (void) createCleanHierarchyDocumentationFile
// Save the markup.
NSError* error = nil;
NSData* markupData = [document XMLDataWithOptions:NSXMLNodePrettyPrint];
+ [document release];
NSString* filename = [self outputBasePath];
filename = [filename stringByAppendingPathComponent:[self outputHierarchyFilename]];
if (![markupData writeToFile:filename options:0 error:&error])
@@ -383,6 +383,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
PREBINDING = NO;
+ RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = macosx10.5;
};
name = Debug;
@@ -396,6 +397,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
+ RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = macosx10.5;
};
name = Release;

0 comments on commit cbde3a7

Please sign in to comment.