Merge pull request #443 from OFFTKP/issue-442

Fix random segmentation fault (fixes #442 fixes #425)
This commit is contained in:
Lior Halphon 2022-04-29 01:11:30 +03:00 committed by GitHub
commit bef1529bb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1195,7 +1195,8 @@ void run_gui(bool is_running)
recalculate_menu_height();
current_selection = 0;
scroll = 0;
do {
while (true) {
SDL_WaitEvent(&event);
/* Convert Joypad and mouse events (We only generate down events) */
if (gui_state != WAITING_FOR_KEY && gui_state != WAITING_FOR_JBUTTON) {
switch (event.type) {
@ -1650,5 +1651,5 @@ void run_gui(bool is_running)
render_texture(pixels, NULL);
#endif
}
} while (SDL_WaitEvent(&event));
}
}