Przeglądaj źródła

yuzu-cmd: ignore bogus timeous from SDL

Liam 4 lat temu
rodzic
commit
c3cc65a11e
1 zmienionych plików z 9 dodań i 1 usunięć
  1. 9 1
      src/yuzu_cmd/emu_window/emu_window_sdl2.cpp

+ 9 - 1
src/yuzu_cmd/emu_window/emu_window_sdl2.cpp

@@ -162,7 +162,15 @@ void EmuWindow_SDL2::WaitEvent() {
     SDL_Event event;
 
     if (!SDL_WaitEvent(&event)) {
-        LOG_CRITICAL(Frontend, "SDL_WaitEvent failed: {}", SDL_GetError());
+        const char* error = SDL_GetError();
+        if (!error || strcmp(error, "") == 0) {
+            // https://github.com/libsdl-org/SDL/issues/5780
+            // Sometimes SDL will return without actually having hit an error condition;
+            // just ignore it in this case.
+            return;
+        }
+
+        LOG_CRITICAL(Frontend, "SDL_WaitEvent failed: {}", error);
         exit(1);
     }