diff --git a/src/ui/tool/control-point-selection.cpp b/src/ui/tool/control-point-selection.cpp index ed131cd7bfe9f80097d2cef0a0640ee37db74cd6..57863e5addbcd2cfbf086b95ffbeefcf0b174ba9 100644 --- a/src/ui/tool/control-point-selection.cpp +++ b/src/ui/tool/control-point-selection.cpp @@ -386,6 +386,10 @@ void ControlPointSelection::_pointGrabbed(SelectableControlPoint *point) void ControlPointSelection::_pointDragged(Geom::Point &new_pos, MotionEvent const &event) { + if (!_grabbed_point) { + return; + } + Geom::Point abs_delta = new_pos - _original_positions[_grabbed_point]; double fdist = Geom::distance(_original_positions[_grabbed_point], _original_positions[_farthest_point]); if (mod_alt_only(event) && fdist > 0) { diff --git a/src/ui/tool/control-point.cpp b/src/ui/tool/control-point.cpp index 7f5729324b0fa4b578eaf65de56de962dbaa5235..2fb1b7f0380d1bda0328e3c0b2dc9a4ffb487d58 100644 --- a/src/ui/tool/control-point.cpp +++ b/src/ui/tool/control-point.cpp @@ -55,6 +55,17 @@ ControlPoint::ControlPoint(SPDesktop *d, Geom::Point const &initial_pos, SPAncho ControlPoint::~ControlPoint() { + // MUST release the static global lock. + // If this point is being deleted (e.g. by LPE Update) + // while it holds the mouse grab, + // Otherwise, Inkscape thinks we are still dragging. + if (_event_grab) { + _canvas_item_ctrl->ungrab(); + + _event_grab = false; + _drag_initiated = false; + } + // avoid storing invalid points in mouseovered_point if (this == mouseovered_point) { _clearMouseover();