Fixing mem leak

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@17551 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Philippe C.D. Robert 2003-08-26 15:53:52 +00:00
parent 770051d866
commit 4a16a7ce1f
2 changed files with 21 additions and 15 deletions

View file

@ -1,3 +1,7 @@
2003-08-25 Philippe C.D. Robert <probert@siggraph.org>
* Fixing "stop logging" fix: PCProjectBuilder.m
2003-08-25 Serg Stoyan <stoyan@on.com.ua>
* PCProjectBuilder.[hm]: stop logging when building/cleaning.

View file

@ -545,10 +545,12 @@
{
NSPipe *logPipe;
NSPipe *errorPipe;
// NSDictionary *optionDict = [currentProject buildOptions];
NSDictionary *env = [[NSProcessInfo processInfo] environment];
NSMutableDictionary *data = [NSMutableDictionary dictionary];
// Support build options!!!
//NSDictionary *optionDict = [currentProject buildOptions];
// Checking prerequisites
if ([[currentProject projectWindow] isDocumentEdited])
{
@ -571,19 +573,18 @@
// Prepearing to building
logPipe = [NSPipe pipe];
readHandle = [logPipe fileHandleForReading];
errorPipe = [NSPipe pipe];
errorReadHandle = [errorPipe fileHandleForReading];
readHandle = [[logPipe fileHandleForReading] retain];
[readHandle waitForDataInBackgroundAndNotify];
[errorReadHandle waitForDataInBackgroundAndNotify];
[NOTIFICATION_CENTER addObserver: self
selector: @selector (logStdOut:)
name: NSFileHandleDataAvailableNotification
object: readHandle];
errorPipe = [NSPipe pipe];
errorReadHandle = [[errorPipe fileHandleForReading] retain];
[errorReadHandle waitForDataInBackgroundAndNotify];
[NOTIFICATION_CENTER addObserver: self
selector: @selector (logErrOut:)
name: NSFileHandleDataAvailableNotification
@ -604,8 +605,6 @@
[NSThread detachNewThreadSelector: @selector(make:)
toTarget: self
withObject: data];
return;
}
- (void)buildDidTerminate
@ -620,8 +619,8 @@
name: NSFileHandleDataAvailableNotification
object: errorReadHandle];
RELEASE (readHandle);
RELEASE (errorReadHandle);
AUTORELEASE(readHandle);
AUTORELEASE(errorReadHandle);
if (status == 0)
{
@ -664,9 +663,6 @@
[buildArgs removeAllObjects];
[buildTarget setString: @"Default"];
RELEASE(makeTask);
makeTask = nil;
}
- (void)popupChanged:(id)sender
@ -773,6 +769,8 @@
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
RETAIN(data);
makeTask = [[NSTask alloc] init];
[makeTask setArguments: [data objectForKey: @"args"]];
[makeTask setCurrentDirectoryPath: [data objectForKey: @"currentDirectory"]];
@ -792,7 +790,11 @@
[self buildDidTerminate];
[pool release];
RELEASE(data);
RELEASE(makeTask);
makeTask = nil;
RELEASE(pool);
}
@end