Turn release messages sent to autorelease pools into drain messages. No

functionality change in non-GC mode, in GC mode it invokes a quick GC pass to
try to delete the short-lived objects.

Also deleted some [pool release] lines just before exit() or return-from-main
statements.  These cause objects to be swapped in and destructors to be run to
no benefit (the OS will reclaim this memory without requiring stuff to be
swapped in when the process exits).



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33146 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
theraven 2011-05-27 12:42:37 +00:00
parent ac36e417ea
commit dbd4c1b77c
15 changed files with 23 additions and 28 deletions

View file

@ -533,6 +533,6 @@ int main(int argc, char** argv)
}
RELEASE(aSpellChecker);
RELEASE(aServer);
RELEASE(_pool);
[_pool drain];
return 0;
}

View file

@ -120,7 +120,6 @@ main(int argc, char** argv, char **env_c)
if (proc == nil)
{
NSLog(@"unable to get process information!");
[pool release];
exit(EXIT_SUCCESS);
}
@ -204,7 +203,7 @@ main(int argc, char** argv, char **env_c)
{
if (verbose > 0)
NSLog(@"couldn't create %@", usrRoot);
[pool release];
[pool drain];
exit(EXIT_FAILURE);
}
@ -264,7 +263,6 @@ main(int argc, char** argv, char **env_c)
{
if (verbose > 0)
NSLog(@"couldn't write %@", str);
[pool release];
exit(EXIT_FAILURE);
}
}
@ -289,12 +287,10 @@ main(int argc, char** argv, char **env_c)
{
if (verbose > 0)
NSLog(@"couldn't write %@", str);
[pool release];
exit(EXIT_FAILURE);
}
}
[pool release];
exit(EXIT_SUCCESS);
}
@ -763,7 +759,7 @@ scanApplications(NSMutableDictionary *services, NSString *path)
}
}
}
[arp release];
[arp drain];
}
static void
@ -815,7 +811,7 @@ scanDynamic(NSMutableDictionary *services, NSString *path)
NSLog(@"bad app info - %@", infPath);
}
}
[arp release];
[arp drain];
}
static void
@ -890,7 +886,7 @@ scanServices(NSMutableDictionary *services, NSString *path)
}
}
}
[arp release];
[arp drain];
}
static NSMutableArray*

View file

@ -54,7 +54,6 @@ main(int argc, char** argv, char **env)
if (proc == nil)
{
NSLog(@"unable to get process information!\n");
[pool release];
exit(EXIT_SUCCESS);
}
@ -93,7 +92,7 @@ main(int argc, char** argv, char **env)
}
NSLog(@"Nothing to do.\n");
RELEASE(pool);
[pool drain];
return(1);
}