Skip to content

Commit

Permalink
Another memory management tweak.
Browse files Browse the repository at this point in the history
  • Loading branch information
rfm committed Jun 22, 2024
1 parent 7532837 commit 1d473e5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Tools/autogsdoc.m
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ standard PropertyList format (not the XML format of OS X), using
{
NSProcessInfo *proc;
unsigned i;
NSMutableDictionary *safe;
NSDictionary *argsRecognized;
NSUserDefaults *defs;
NSFileManager *mgr;
Expand Down Expand Up @@ -728,6 +729,11 @@ standard PropertyList format (not the XML format of OS X), using

outer = [NSAutoreleasePool new];

/* Objects we want to persist until the outer autorelease pool is exited
* can be stored in the 'safe; dictionary.
*/
safe = [NSMutableDictionary dictionary];

#ifndef HAVE_LIBXML
NSLog(@"ERROR: The GNUstep Base Library was built\n"
@" without an available libxml library. Autogsdoc needs the libxml\n"
Expand Down Expand Up @@ -897,6 +903,7 @@ standard PropertyList format (not the XML format of OS X), using
declared = [defs stringForKey: @"Declared"];
project = [defs stringForKey: @"Project"];
refsName = [project stringByAppendingPathExtension: @"igsdoc"];
[safe setObject: refsName forKey: @"refsName"];

headerDirectory = [defs stringForKey: @"HeaderDirectory"];
if (headerDirectory == nil)
Expand Down Expand Up @@ -1006,6 +1013,7 @@ standard PropertyList format (not the XML format of OS X), using
stringByAppendingPathComponent: project];
refsFile = [refsFile stringByAppendingPathExtension: @"igsdoc"];
projectRefs = AUTORELEASE([AGSIndex new]);
[safe setObject: projectRefs forKey: @"projectRefs"];
originalIndex = nil;
rDate = [NSDate distantPast];
if ([mgr isReadableFileAtPath: refsFile] == YES)
Expand All @@ -1020,6 +1028,7 @@ standard PropertyList format (not the XML format of OS X), using
{
NSDictionary *dict;

[safe setObject: originalIndex forKey: @"originalIndex"];
[projectRefs mergeRefs: originalIndex override: NO];
if (verbose)
{
Expand Down Expand Up @@ -1730,11 +1739,12 @@ standard PropertyList format (not the XML format of OS X), using
NSLog(@"Sorry unable to write %@", refsFile);
}
}
DESTROY(originalIndex);
originalIndex = nil;
DESTROY(merged);
}

globalRefs = AUTORELEASE([AGSIndex new]);
[safe setObject: globalRefs forKey: @"globalRefs"];

/*
* 8) If we are either generating html output, or relocating existing
Expand Down

0 comments on commit 1d473e5

Please sign in to comment.