lcl: fixed a memory leak when canceling drag of dead control

git-svn-id: trunk@37371 -
This commit is contained in:
paul 2012-05-21 07:21:48 +00:00
parent 136bb2bf67
commit e4be3b0c67

View File

@ -266,12 +266,8 @@ procedure TDragPerformer.Notification(AComponent: TComponent;
begin
if Operation = opRemove then
begin
if Assigned(FDragObject) then
if (AComponent = FDragObject.Control) then
DragStop(False)
else
if (AComponent = FDragObject.DragTarget) then
DragMove(FDragObject.DragPos);
if Assigned(FDragObject) and (AComponent = FDragObject.DragTarget) then
DragMove(FDragObject.DragPos);
end;
end;
@ -782,6 +778,8 @@ begin
if FDockSites.Count = 0 then
FreeAndNil(FDockSites);
end;
if (AComponent is TControl) and Dragging(TControl(AComponent)) then
DragStop(False);
end;
end;