mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 05:19:25 +02:00
dont crash if CancelDrag is called during DragOver (merge me)
git-svn-id: trunk@13046 -
This commit is contained in:
parent
277aed08b2
commit
2147234522
@ -241,6 +241,7 @@ Procedure DragTo(const Position: TPoint);
|
||||
var
|
||||
TargetControl: TControl;
|
||||
ADragCursor: TCursor;
|
||||
AAccepted: Boolean;
|
||||
Begin
|
||||
{$IFDEF VerboseDrag}
|
||||
DebugLn('DragTo P=', IntToStr(Position.X), ',', IntToStr(Position.Y));
|
||||
@ -254,7 +255,7 @@ Begin
|
||||
exit;
|
||||
end;
|
||||
|
||||
TargetControl := GetDragTargetAt(Position,DragControl.DragKind,DragControl);
|
||||
TargetControl := GetDragTargetAt(Position, DragControl.DragKind, DragControl);
|
||||
|
||||
if DragControl.DragKind = dkDrag then
|
||||
ActiveDrag := dopDrag
|
||||
@ -278,7 +279,10 @@ Begin
|
||||
begin
|
||||
// same target => send dmDragMove
|
||||
DragObject.DragPos := Position;
|
||||
ADragCursor := DragObject.GetDragCursor(SendDragOver(dmDragMove), Position.X, Position.Y);
|
||||
AAccepted := SendDragOver(dmDragMove);
|
||||
// on DragMove someone can call CancelDrag and this cause crash w/o this check
|
||||
if DragObject = nil then Exit;
|
||||
ADragCursor := DragObject.GetDragCursor(AAccepted, Position.X, Position.Y);
|
||||
if DragImages <> nil then
|
||||
begin
|
||||
if (DragObject.DragTarget = nil) or (csDisplayDragImage in DragObject.DragTarget.ControlStyle) or
|
||||
|
Loading…
Reference in New Issue
Block a user