Skip to content

Commit

Permalink
Fixed several memory leaks (say hello to static analizer).
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaz committed Sep 15, 2009
1 parent 56d91f9 commit cbde3a7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Systemator.m
Expand Up @@ -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];
Expand Down
5 changes: 5 additions & 0 deletions XMLOutputGenerator.m
Expand Up @@ -332,6 +332,7 @@ - (void) mergeCleanCategoriesToKnownObjects
[nameNode setStringValue:classSectionName];
}
[classSectionsNode addChild:classSectionNode];
[classSectionNode release];
}
}
else
Expand All @@ -350,6 +351,7 @@ - (void) mergeCleanCategoriesToKnownObjects
{
NSXMLElement* classMemberNode = [memberNode copy];
[sectionNode addChild:classMemberNode];
[classMemberNode release];
}

// Append the section data to the main class document.
Expand Down Expand Up @@ -380,6 +382,7 @@ - (void) mergeCleanCategoriesToKnownObjects
index);
NSXMLElement* insertedNode = [categoryFileNode copy];
[parentNode insertChild:insertedNode atIndex:index + 1];
[insertedNode release];
index++;
}
}
Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -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])
Expand Down
2 changes: 2 additions & 0 deletions appledoc.xcodeproj/project.pbxproj
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit cbde3a7

Please sign in to comment.