prevent to retrieve the IProcInputHandler service each time required

This commit is contained in:
Basile Burg 2019-02-03 15:46:49 +01:00
parent e6204b49e1
commit 0abd58637b
1 changed files with 8 additions and 6 deletions

View File

@ -395,6 +395,7 @@ type
fDoc: TDexedMemo;
fFirstTimeRun: boolean;
fMultidoc: IMultiDocHandler;
fProcInputHandler: IProcInputHandler;
fScCollectCount: Integer;
fUpdateCount: NativeInt;
fProject: ICommonProject;
@ -1302,6 +1303,7 @@ begin
mainMenu.Items.Remove(mnuItemHelp);
mainMenu.Items.Add(mnuItemHelp);
fProcInputHandler := getprocInputHandler;
fInitialized := true;
end;
@ -1954,21 +1956,21 @@ end;
procedure TMainForm.FreeRunnableProc;
var
fname: string;
f: string;
begin
if fRunProc.isNil then
exit;
fname := fRunProc.Executable;
if getprocInputHandler.process = fRunProc then
f := fRunProc.Executable;
if fProcInputHandler.process = fRunProc then
begin
getMessageDisplay.message('the execution of a runnable module ' +
'has been implicitly aborted', fDoc, amcEdit, amkWarn);
getprocInputHandler.addProcess(nil);
fProcInputHandler.addProcess(nil);
end;
killProcess(fRunProc);
if fname.fileExists and (fname.extractFilePath = GetTempDir(false)) then
sysutils.DeleteFile(fname);
if f.fileExists and (f.extractFilePath = GetTempDir(false)) then
sysutils.DeleteFile(f);
end;
procedure TMainForm.SaveLastDocsAndProj;