IDE: fixed valgrind warning TExtToolView.Destroy, issue #38959

git-svn-id: trunk@65170 -
This commit is contained in:
mattias 2021-06-03 19:13:35 +00:00
parent 8a96677e5d
commit b0732509f7

View File

@ -2323,20 +2323,15 @@ end;
destructor TExtToolView.Destroy;
begin
// wait for other threads to finish their access
EnterCriticalSection;
try
if (Tool<>nil) and (not (csDestroying in Tool.ComponentState)) then
Tool.RemoveView(Self);
RemoveAsyncOnChanged;
ClearLines;
FreeAndNil(FProgressLine);
FreeAndNil(FPendingLines);
FreeAndNil(FPendingProgressLine);
inherited Destroy;
finally
LeaveCriticalSection;
end;
if (Tool<>nil) and (not (csDestroying in Tool.ComponentState)) then
Tool.RemoveView(Self);
// no need for EnterCriticalSection, issue 38959
RemoveAsyncOnChanged;
ClearLines;
FreeAndNil(FProgressLine);
FreeAndNil(FPendingLines);
FreeAndNil(FPendingProgressLine);
inherited Destroy;
FreeAndNil(FLines);
end;