Converter: Prevent the IDE freezing when cancelling the conversion. A non-started thread was waited for.

git-svn-id: trunk@53890 -
This commit is contained in:
juha 2017-01-06 14:03:13 +00:00
parent 7f70c71a43
commit 714bd8024f

View File

@ -31,7 +31,8 @@ interface
uses
Classes, SysUtils, AVL_Tree,
Forms, Controls, Dialogs, StdCtrls, Buttons, ButtonPanel, ComCtrls,
// LCL
Forms, Controls, Dialogs, StdCtrls, Buttons, ButtonPanel, ComCtrls, LCLProc,
// LazUtils
FileUtil, LazFileUtils, DividerBevel, LazConfigStorage,
// CodeTools
@ -979,7 +980,8 @@ end;
procedure TConvertSettingsForm.CancelButtonClick(Sender: TObject);
begin
if Assigned(fCacheUnitsThread) then begin
if Assigned(fCacheUnitsThread) and fThreadStarted then
begin
(fCacheUnitsThread as TCacheUnitsThread).Searcher.Stop;
fCacheUnitsThread.WaitFor;
end;