initialize the PID and use it

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@39717 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2016-05-03 21:31:37 +00:00
parent 55b4d1a424
commit 18d31ca7ee

View file

@ -138,6 +138,8 @@ static NSImage *downImage = nil;
[viewDelegate setTextView:debuggerView];
[viewDelegate setDebugger:self];
[viewDelegate release];
subProcessId = 0;
}
return self;
}
@ -221,17 +223,16 @@ static NSImage *downImage = nil;
// kill process
- (void) interrupt
{
int pid = [debuggerView subProcessId];
if(pid != 0)
if(subProcessId != 0)
{
#ifndef __MINGW32__
kill(pid,SIGINT);
kill(subProcessId,SIGINT);
#else
// on windows we run tskill as a shell command
NSTask *t;
NSArray *args;
args = [NSArray arrayWithObjects:[NSString stringWithFormat:@"%d", pid], nil];
args = [NSArray arrayWithObjects:[NSString stringWithFormat:@"%d", subProcessId], nil];
t = [NSTask new];
[t setLaunchPath:@"tskill.exe"];
[t launch];