Only return window_event_result::deleted from game_handler when Game_wind was deleted in that call of game_handler
Fixes freeze when aborting game while demo is recording
This commit is contained in:
parent
515476f02b
commit
17ca665ed5
|
@ -1212,6 +1212,8 @@ namespace dsx {
|
||||||
// Event handler for the game
|
// Event handler for the game
|
||||||
window_event_result game_handler(window *,const d_event &event, const unused_window_userdata_t *)
|
window_event_result game_handler(window *,const d_event &event, const unused_window_userdata_t *)
|
||||||
{
|
{
|
||||||
|
const bool was_game_wind = Game_wind != nullptr;
|
||||||
|
|
||||||
switch (event.type)
|
switch (event.type)
|
||||||
{
|
{
|
||||||
case EVENT_WINDOW_ACTIVATED:
|
case EVENT_WINDOW_ACTIVATED:
|
||||||
|
@ -1304,8 +1306,8 @@ window_event_result game_handler(window *,const d_event &event, const unused_win
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we deleted the window, tell the event loop
|
// If we deleted the window ***in this call of the handler***, tell the event loop
|
||||||
return Game_wind ? window_event_result::ignored : window_event_result::deleted;
|
return Game_wind || !was_game_wind ? window_event_result::ignored : window_event_result::deleted;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialise game, actually runs in main event loop
|
// Initialise game, actually runs in main event loop
|
||||||
|
|
Loading…
Reference in a new issue