Skip to content

Commit

Permalink
Stage: clear __lastClickTarget on mouseDown if the target has changed
Browse files Browse the repository at this point in the history
Ensures the object won't become a memory leak
  • Loading branch information
joshtynjala committed Jun 5, 2024
1 parent 238b3a9 commit c76ba4a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/openfl/display/Stage.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2569,6 +2569,13 @@ class Stage extends DisplayObjectContainer #if lime implements IModule #end
}

__mouseDownLeft = target;
if (__lastClickTarget != target)
{
// the target has changed since the previous click
// so we can't double-click the old target anymore
__lastClickTarget = null;
__lastClickTime = 0;
}
MouseEvent.__buttonDown = true;
supportsClickCount = true;

Expand Down

0 comments on commit c76ba4a

Please sign in to comment.