mirror of https://github.com/OpenRCT2/OpenRCT2.git
fix #3294: crash when closing a window being dragged
This commit is contained in:
parent
2df58747e5
commit
de79bd4599
|
@ -535,7 +535,13 @@ static void input_viewport_drag_continue()
|
||||||
dx = newDragX - gInputDragLastX;
|
dx = newDragX - gInputDragLastX;
|
||||||
dy = newDragY - gInputDragLastY;
|
dy = newDragY - gInputDragLastY;
|
||||||
w = window_find_by_number(_dragWidget.window_classification, _dragWidget.window_number);
|
w = window_find_by_number(_dragWidget.window_classification, _dragWidget.window_number);
|
||||||
assert(w != NULL);
|
|
||||||
|
// #3294: Window can be closed during a drag session, so just finish
|
||||||
|
// the session if the window no longer exists
|
||||||
|
if (w == NULL) {
|
||||||
|
input_viewport_drag_end();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
viewport = w->viewport;
|
viewport = w->viewport;
|
||||||
_ticksSinceDragStart += RCT2_GLOBAL(RCT2_ADDRESS_TICKS_SINCE_LAST_UPDATE, sint16);
|
_ticksSinceDragStart += RCT2_GLOBAL(RCT2_ADDRESS_TICKS_SINCE_LAST_UPDATE, sint16);
|
||||||
|
|
Loading…
Reference in New Issue