Skip to content

Commit

Permalink
GPUThread: Fix crash during FSUI language switch
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Jan 31, 2025
1 parent 96058f5 commit 03181d1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/gpu_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,13 @@ void GPUThread::Internal::GPUThreadEntryPoint()

void GPUThread::Internal::DoRunIdle()
{
if (!g_gpu_device->HasMainSwapChain()) [[unlikely]]
{
// only happens during language switch
Timer::NanoSleep(16 * 1000 * 1000);
return;
}

if (!PresentFrameAndRestoreContext())
return;

Expand Down

0 comments on commit 03181d1

Please sign in to comment.