Fix problem with launcher panel.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@37787 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Germán Arias 2014-04-06 23:40:32 +00:00
parent ae84c3ad36
commit 761ba276ce
3 changed files with 38 additions and 7 deletions

View file

@ -1,3 +1,10 @@
2014-04-06 German Arias <germanandre@gmx.es>
* Headers/ProjectCenter/PCProjectLauncher.h: Add new variable
_isErrorRunning.
* Framework/PCProjectLauncher.m: Remove observer in -logStdOut: and
-logErrOut:. And wait until receive all data in -runDidTerminate:.
2014-04-02 German Arias <germanandre@gmx.es>
* Framework/PCFileCreator.m (-replaceTagsInFileAtPath:withProject:):

View file

@ -399,6 +399,7 @@ enum {
[debugButton setEnabled:NO];
_isRunning = YES;
_isErrorRunning = YES;
RELEASE(args);
}
@ -409,7 +410,16 @@ enum {
return;
}
[NOTIFICATION_CENTER removeObserver:self];
[NOTIFICATION_CENTER removeObserver: self
name: NSTaskDidTerminateNotification
object: launchTask];
// Wait if there are data available.
if (_isRunning || _isErrorRunning)
{
[[NSRunLoop currentRunLoop] runMode: NSDefaultRunLoopMode
beforeDate: [NSDate distantFuture]];
}
[runButton setState:NSOffState];
[debugButton setState:NSOffState];
@ -419,7 +429,6 @@ enum {
RELEASE(launchTask);
launchTask = nil;
_isRunning = NO;
_isDebugging = NO;
}
@ -428,24 +437,38 @@ enum {
{
NSData *data;
if ((data = [readHandle availableData]))
if ((data = [readHandle availableData]) && [data length] > 0)
{
[self logData:data error:NO];
[readHandle waitForDataInBackgroundAndNotifyForModes:nil];
}
else
{
[NOTIFICATION_CENTER removeObserver: self
name: NSFileHandleDataAvailableNotification
object: readHandle];
[readHandle waitForDataInBackgroundAndNotifyForModes:nil];
_isRunning = NO;
}
}
- (void)logErrOut:(NSNotification *)aNotif
{
NSData *data;
if ((data = [errorReadHandle availableData]))
if ((data = [errorReadHandle availableData]) && [data length] > 0)
{
[self logData:data error:YES];
[errorReadHandle waitForDataInBackgroundAndNotifyForModes:nil];
}
else
{
[NOTIFICATION_CENTER removeObserver: self
name: NSFileHandleDataAvailableNotification
object: errorReadHandle];
_isErrorRunning = NO;
}
[errorReadHandle waitForDataInBackgroundAndNotifyForModes:nil];
}
@end

View file

@ -50,6 +50,7 @@
id<CodeDebugger> debugger;
BOOL _isRunning;
BOOL _isErrorRunning;
BOOL _isDebugging;
}