Skip to content

Commit

Permalink
patch file
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-T committed May 18, 2023
1 parent 680027c commit f05658a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions doc/lcl_dragmanager.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/lcl/include/dragmanager.inc b/lcl/include/dragmanager.inc
index 1fb2356477..c7a405b9be 100644
--- a/lcl/include/dragmanager.inc
+++ b/lcl/include/dragmanager.inc
@@ -170,6 +170,7 @@ procedure TDragPerformer.DragMove(APosition: TPoint);
var
ATarget: TControl;
DragCursor: TCursor;
+ bAccept: boolean;
begin
if FDragObject = nil then
Exit;
@@ -190,7 +191,12 @@ begin
//TODO: Need to rewrite this(or even delete it, back to the roots)
if FDragObject.DragTarget <> nil then
FDragObject.DragTargetPos := FDragObject.DragTarget.ScreenToClient(APosition);
- DragCursor := FDragObject.GetDragCursor(SendCmDragMsg(FDragObject, dmDragMove),APosition.X, APosition.Y);
+ bAccept := SendCmDragMsg(FDragObject, dmDragMove);
+ if FDragObject = nil then // this hides possible Access Violation
+ Exit;
+ DragCursor := FDragObject.GetDragCursor(bAccept, APosition.X, APosition.Y);
+ if FDragObject = nil then
+ Exit;
if FDragImageList <> nil then
begin
if (ATarget = nil) or (csDisplayDragImage in ATarget.ControlStyle) or

0 comments on commit f05658a

Please sign in to comment.