From 18d31ca7ee3e1b500baa3036ffd25f8b04e7f789 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Tue, 3 May 2016 21:31:37 +0000 Subject: [PATCH] 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 --- Modules/Debuggers/ProjectCenter/PCDebugger.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Modules/Debuggers/ProjectCenter/PCDebugger.m b/Modules/Debuggers/ProjectCenter/PCDebugger.m index 5e1040e..2fc516f 100644 --- a/Modules/Debuggers/ProjectCenter/PCDebugger.m +++ b/Modules/Debuggers/ProjectCenter/PCDebugger.m @@ -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];