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