Make -drain and -release in NSAutoreleasePool do the same thing (rather than one calling the other) in non-GC mode.

Replace all -release messages sent to autorelease pools with -drain.  In non-GC mode, these are equivalent.  In GC mode, these trigger a collection.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33143 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
theraven 2011-05-27 11:48:44 +00:00
parent 3dd46a1d8c
commit e50e12129e
28 changed files with 61 additions and 59 deletions

View file

@ -1962,7 +1962,7 @@ static NSString *mainFont = nil;
node = tmp;
}
}
RELEASE(arp);
[arp drain];
}
/**

View file

@ -542,7 +542,7 @@ setDirectory(NSMutableDictionary *dict, NSString *path)
{
CREATE_AUTORELEASE_POOL(pool);
setDirectory(refs, path);
RELEASE(pool);
[pool drain];
}
}

View file

@ -1474,7 +1474,7 @@ static BOOL snuggleStart(NSString *t)
[buf appendString: @"\n"];
}
}
RELEASE(arp);
[arp drain];
return ind;
}

View file

@ -1744,7 +1744,7 @@ recheck:
{
if (buffer[pos] == ')' || buffer[pos] == ',')
{
RELEASE(arp);
[arp drain];
return d;
}
else
@ -1877,7 +1877,7 @@ recheck:
}
DESTROY(comment);
RELEASE(arp);
[arp drain];
if (inArgList == NO)
{
/*
@ -1907,7 +1907,7 @@ recheck:
}
fail:
DESTROY(comment);
RELEASE(arp);
[arp drain];
return nil;
}
@ -2206,7 +2206,7 @@ fail:
*/
[self skipUnit];
DESTROY(comment);
RELEASE(arp);
[arp drain];
return [NSMutableDictionary dictionary];
}
else
@ -2245,13 +2245,13 @@ fail:
unitName = nil;
DESTROY(comment);
RELEASE(arp);
[arp drain];
return dict;
fail:
unitName = nil;
DESTROY(comment);
RELEASE(arp);
[arp drain];
return nil;
}
@ -2401,13 +2401,13 @@ fail:
unitName = nil;
DESTROY(comment);
RELEASE(arp);
[arp drain];
return dict;
fail:
unitName = nil;
DESTROY(comment);
RELEASE(arp);
[arp drain];
return nil;
}
@ -2950,14 +2950,14 @@ fail:
}
itemName = nil;
RELEASE(arp);
[arp drain];
IF_NO_GC([method autorelease];)
return method;
fail:
itemName = nil;
DESTROY(comment);
RELEASE(arp);
[arp drain];
RELEASE(method);
return nil;
}
@ -3661,14 +3661,14 @@ fail:
unitName = nil;
DESTROY(comment);
RELEASE(arp);
[arp drain];
IF_NO_GC([dict autorelease];)
return dict;
fail:
unitName = nil;
DESTROY(comment);
RELEASE(arp);
[arp drain];
RELEASE(dict);
return nil;
}
@ -4108,7 +4108,7 @@ fail:
buffer = [data mutableBytes];
pos = 0;
lines = [[NSArray alloc] initWithArray: a];
RELEASE(arp);
[arp drain];
IF_NO_GC([lines autorelease];)
IF_NO_GC([data autorelease];)
}

View file

@ -1351,7 +1351,7 @@ int main (int argc, char** argv, char** env)
}
RELEASE (linker);
RELEASE (pool);
[pool drain];
return 0;
}

View file

@ -64,7 +64,7 @@ main(int argc, char** argv, char **env)
if (proc == nil)
{
GSPrintf(stderr, @"gspath: unable to get process information!\n");
[pool release];
[pool drain];
return 1;
}
@ -116,7 +116,7 @@ main(int argc, char** argv, char **env)
}
if (ok == YES)
{
[pool release];
[pool drain];
return 0;
}
}
@ -141,6 +141,6 @@ main(int argc, char** argv, char **env)
@"user\n"
@" The GNUstep home directory of the current user\n\n"
);
[pool release];
[pool drain];
return 1;
}

View file

@ -166,7 +166,7 @@ int main (int argc, const char *argv[])
puts(" if -output is specified.");
}
[pool release];
[pool drain];
exit(0); // insure the process exit status is 0
return 0; // ...and make main fit the ANSI spec.
}