1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-29 09:44:52 +01:00

Prevent recently closed window from having actions performed on it (#8143)

Fixes #8121
This commit is contained in:
Michał Janiszewski
2018-10-24 20:57:39 +02:00
committed by GitHub
parent 25561714ec
commit 95175b44e9
3 changed files with 8 additions and 5 deletions

View File

@@ -659,7 +659,7 @@ static void window_options_mouseup(rct_window* w, rct_widgetindex widgetIndex)
{
case WIDX_CLOSE:
window_close(w);
break;
return;
case WIDX_TAB_1:
case WIDX_TAB_2:
case WIDX_TAB_3:

View File

@@ -285,11 +285,13 @@ void window_text_input_key(rct_window* w, char keychar)
{
context_stop_text_input();
window_close(w);
rct_window* calling_w = window_find_by_number(calling_class, calling_number);
// Window was closed and its unique_ptr is gone,
// don't try invalidating it.
w = window_find_by_number(calling_class, calling_number);
// Pass back the text that has been entered.
// ecx when nonzero means text input success
if (calling_w)
window_event_textinput_call(calling_w, calling_widget, text_input);
if (w)
window_event_textinput_call(w, calling_widget, text_input);
}
window_invalidate(w);
@@ -303,6 +305,7 @@ void window_text_input_update7(rct_window* w)
if (!calling_w)
{
window_close(w);
return;
}
// Used to blink the cursor.

View File

@@ -796,7 +796,7 @@ static void window_tile_inspector_mouseup(rct_window* w, rct_widgetindex widgetI
case WIDX_CLOSE:
tool_cancel();
window_close(w);
break;
return;
case WIDX_BUTTON_CORRUPT:
window_tile_inspector_insert_corrupt_element(windowTileInspectorSelectedIndex);
break;