diff --git a/ChangeLog b/ChangeLog index 86310df..49214ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-08-25 Philippe C.D. Robert + + * Fixing "stop logging" fix: PCProjectBuilder.m + 2003-08-25 Serg Stoyan * PCProjectBuilder.[hm]: stop logging when building/cleaning. diff --git a/PCLib/PCProjectBuilder.m b/PCLib/PCProjectBuilder.m index 29a2a28..8095ee6 100644 --- a/PCLib/PCProjectBuilder.m +++ b/PCLib/PCProjectBuilder.m @@ -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